Skip to content

Commit

Permalink
fix: Use os_uname() to check for Linux
Browse files Browse the repository at this point in the history
In build environments like Fedora's mockbuild, there is no OSTYPE
environment variable set. Use a more secure method to detect Linux.
  • Loading branch information
cryptomilk committed Jan 14, 2024
1 parent 77f1bd3 commit 17992ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ else
-- Normal lua will only have \ for path separator on windows.
utils.isWindows = package.config:find("\\") and true or false
if not utils.isWindows then
local _os = os.getenv('RUNNER_OS') or os.getenv('OSTYPE')
if (_os and _os:lower():match('linux')) then
local os = uv.os_uname()
if os.sysname == "Linux" then
utils.isLinux = true
end
end
Expand Down

0 comments on commit 17992ab

Please sign in to comment.