Comparison

util/prosodyctl.lua @ 11291:9a98464a35e4

util.prosodyctl: Propagate status from luarocks invocation
author Kim Alvefur <zash@zash.se>
date Thu, 21 Jan 2021 18:43:16 +0100
parent 11290:7919ecdc4a72
child 11292:ad5cd9b0f8de
comparison
equal deleted inserted replaced
11290:7919ecdc4a72 11291:9a98464a35e4
224 if operation == "install" then 224 if operation == "install" then
225 show_message("Installing %s at %s", mod, dir); 225 show_message("Installing %s at %s", mod, dir);
226 elseif operation == "remove" then 226 elseif operation == "remove" then
227 show_message("Removing %s from %s", mod, dir); 227 show_message("Removing %s from %s", mod, dir);
228 end 228 end
229 os.execute(render_cli("luarocks {op} --tree={dir} {server&--server={server}} {mod?}", { 229 local ok, where, code = os.execute(render_cli("luarocks {op} --tree={dir} {server&--server={server}} {mod?}", {
230 dir = dir; op = operation; mod = mod; server = server; 230 dir = dir; op = operation; mod = mod; server = server;
231 })); 231 }));
232 if type(ok) == "number" then ok, code = ok == 0, ok; end
233 if not ok then
234 return code;
235 end
232 if operation == "install" then 236 if operation == "install" then
233 show_module_configuration_help(mod); 237 show_module_configuration_help(mod);
234 end 238 end
239 return true;
235 end 240 end
236 241
237 return { 242 return {
238 show_message = show_message; 243 show_message = show_message;
239 show_warning = show_message; 244 show_warning = show_message;