From 52ced641548d1d8ea5ed62c5fb4cbe628315165b Mon Sep 17 00:00:00 2001 From: Lorenzo Cogotti Date: Sun, 2 Oct 2022 16:34:08 +0200 Subject: [PATCH] [crush] Fix os.execute() failure detection on LuaJIT. --- crush.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crush.lua b/crush.lua index d7d4cd2..7727896 100644 --- a/crush.lua +++ b/crush.lua @@ -205,7 +205,11 @@ local function fetch(dep) fullcmd = chdir("lib", quiet(cmd)) end - if not os.execute(fullcmd) then + -- On success, os.execute() returns: + -- true on regular Lua + -- 0 on LuaJIT (actual OS error code) + local code = os.execute(fullcmd) + if code ~= true and code ~= 0 then error(dep.name..": Dependency fetch failed ("..cmd..").") end end