From 17992ab796e4316cc47176d1dcf081380ac4a0c9 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Sat, 13 Jan 2024 21:29:09 +0100 Subject: [PATCH] fix: Use os_uname() to check for Linux In build environments like Fedora's mockbuild, there is no OSTYPE environment variable set. Use a more secure method to detect Linux. --- lib/utils.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/utils.lua b/lib/utils.lua index 3bbc99ec..4dbf1303 100644 --- a/lib/utils.lua +++ b/lib/utils.lua @@ -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