mirror of
https://github.com/neovim/neovim.git
synced 2025-10-21 17:21:49 +00:00
test: is_os() #10933
- Move os_name() up to "global helpers". - Rename it to is_os(). - Make it depend on uname() instead of a running Nvim instance.
This commit is contained in:
@@ -190,6 +190,15 @@ module.uname = (function()
|
||||
end)
|
||||
end)()
|
||||
|
||||
function module.is_os(s)
|
||||
if not (s == 'win' or s == 'mac' or s == 'unix') then
|
||||
error('unknown platform: '..tostring(s))
|
||||
end
|
||||
return ((s == 'win' and module.iswin())
|
||||
or (s == 'mac' and module.uname() == 'darwin')
|
||||
or (s == 'unix'))
|
||||
end
|
||||
|
||||
local function tmpdir_get()
|
||||
return os.getenv('TMPDIR') and os.getenv('TMPDIR') or os.getenv('TEMP')
|
||||
end
|
||||
|
Reference in New Issue
Block a user