http-codes.nvim/lua/telescope/_extensions/getOS.lua
2023-02-14 00:08:47 +00:00

11 lines
303 B
Lua

return function()
-- ask LuaJIT first
-- will return "Windows", "Linux", "OSX", "BSD", "POSIX" or "Other"
if jit then return jit.os end
-- Unix, Linux variants
local fh, _ = assert(io.popen('uname -o 2>/dev/null', 'r'))
if fh then return fh:read() end
return 'Windows'
end