fix: pre-commit
This commit is contained in:
parent
01248ffcff
commit
017c1873b7
11 changed files with 146 additions and 128 deletions
|
|
@ -1,17 +1,23 @@
|
|||
local OS_TO_OPEN_URL = {
|
||||
OSX = 'open %s',
|
||||
Windows = 'start %s',
|
||||
OSX = 'open %s',
|
||||
Windows = 'start %s',
|
||||
}
|
||||
|
||||
local function get_os()
|
||||
if jit then return jit.os end
|
||||
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
|
||||
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'
|
||||
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,
|
||||
get_open_url = function()
|
||||
return OS_TO_OPEN_URL[get_os()] or 'xdg-open %s'
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue