Changeset

11291:9a98464a35e4

util.prosodyctl: Propagate status from luarocks invocation
author Kim Alvefur <zash@zash.se>
date Thu, 21 Jan 2021 18:43:16 +0100
parents 11290:7919ecdc4a72
children 11292:ad5cd9b0f8de
files util/prosodyctl.lua
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/util/prosodyctl.lua	Thu Jan 21 18:39:18 2021 +0100
+++ b/util/prosodyctl.lua	Thu Jan 21 18:43:16 2021 +0100
@@ -226,12 +226,17 @@
 	elseif operation == "remove" then
 		show_message("Removing %s from %s", mod, dir);
 	end
-	os.execute(render_cli("luarocks {op} --tree={dir} {server&--server={server}} {mod?}", {
+	local ok, where, code = os.execute(render_cli("luarocks {op} --tree={dir} {server&--server={server}} {mod?}", {
 				dir = dir; op = operation; mod = mod; server = server;
 		}));
+	if type(ok) == "number" then ok, code = ok == 0, ok; end
+	if not ok then
+		return code;
+	end
 	if operation == "install" then
 		show_module_configuration_help(mod);
 	end
+	return true;
 end
 
 return {