Skip to content

Commit

Permalink
feat: add utils.isLinux
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaozg committed Jul 2, 2023
1 parent ab6883e commit 6d1dae3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ if _G.jit and _G.jit.os then
else
-- Normal lua will only have \ for path separator on windows.
utils.isWindows = package.config:find("\\") and true or false
local f = io.popen('uname', 'r')
if f then
local line = f:read("*l")
utils.isLinux = line == 'Linux'
f:close()
if not utils.isWindows then
local _os = os.getenv('RUNNER_OS') or os.getenv('OSTYPE')
if (_os and _os:lower():match('linux')) then
utils.isLinux = true
end
end
end

Expand Down

0 comments on commit 6d1dae3

Please sign in to comment.