Skip to content

Commit e13a555

Browse files
committed
Fixed incorrect handling of os.execute() return
1 parent facbcbe commit e13a555

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

installer/premake5.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ local function mkdir(dir)
3939
end
4040

4141
local ret = exec("1>nul 2>nul md " .. path.translate(dir))
42-
if ret ~= 0 then
42+
if not ret then
4343
error("Failed to create directory '" .. dir .. "'")
4444
end
4545
end
@@ -76,7 +76,7 @@ end
7676

7777
--------------------------------------------------------------------------------
7878
local function have_required_tool(name)
79-
return (exec("1>nul 2>nul where " .. name) == 0)
79+
return exec("1>nul 2>nul where " .. name)
8080
end
8181

8282
--------------------------------------------------------------------------------
@@ -142,12 +142,12 @@ newaction {
142142
exec(premake .. " --clink_ver=" .. clink_ver .. " " .. toolchain)
143143

144144
ret = exec("msbuild /m /v:q /p:configuration=release /p:platform=win32 .build/" .. toolchain .. "/clink.sln")
145-
if ret ~= 0 then
145+
if not ret then
146146
x86_ok = false
147147
end
148148

149149
ret = exec("msbuild /m /v:q /p:configuration=release /p:platform=x64 .build/" .. toolchain .. "/clink.sln")
150-
if ret ~= 0 then
150+
if not ret then
151151
x64_ok = false
152152
end
153153
elseif have_mingw then
@@ -157,12 +157,12 @@ newaction {
157157

158158
local ret
159159
ret = exec("1>nul mingw32-make CC=gcc config=release_x32 -j%number_of_processors%")
160-
if ret ~= 0 then
160+
if not ret then
161161
x86_ok = false
162162
end
163163

164164
ret = exec("1>nul mingw32-make CC=gcc config=release_x64 -j%number_of_processors%")
165-
if ret ~= 0 then
165+
if not ret then
166166
x64_ok = false
167167
end
168168

0 commit comments

Comments
 (0)