feat: initial commit

This commit is contained in:
Barrett Ruth 2024-06-17 17:56:51 -05:00
parent b440657495
commit e48a8f9c0c
10 changed files with 153 additions and 78 deletions

17
lua/http-codes/os.lua Normal file
View file

@ -0,0 +1,17 @@
local OS_TO_OPEN_URL = {
OSX = 'open %s',
Windows = 'start %s',
}
local function get_os()
if jit then return jit.os end
local fh, _ = assert(io.popen('uname -o 2>/dev/null', 'r'))
if fh then return fh:read() end
return fh and fh:read() or 'Windows'
end
return {
get_open_url = function() return OS_TO_OPEN_URL[get_os()] or 'xdg-open %s' end,
}