aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/util.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/util.lua b/lib/util.lua
index 9f8cb22..f80ae87 100644
--- a/lib/util.lua
+++ b/lib/util.lua
@@ -161,8 +161,10 @@ local run = function (args)
capture_stdout = true,
args = args,
})
- stdout = cmd.stdout
- rc = (cmd.status >= 0)
+ if cmd then
+ stdout = cmd.stdout
+ rc = (cmd.status >= 0)
+ end
else
cmd = io.popen(table_to_cmd(args))
if cmd then
@@ -172,7 +174,7 @@ local run = function (args)
end
end
- return stdout, rc
+ return stdout or "", rc
end
return {