aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-01-21 19:04:57 +0100
committerKim Alvefur <zash@zash.se>2021-01-21 19:04:57 +0100
commita97dd68fa12fc5a55939024e93526b1abb4c7c44 (patch)
treeedea934b011a6ae83e541ebac17b08564121c632
parent37628ed867624dd9b8bfb503c1fd0785ff70667c (diff)
downloadprosody-a97dd68fa12fc5a55939024e93526b1abb4c7c44.tar.gz
prosody-a97dd68fa12fc5a55939024e93526b1abb4c7c44.zip
prosodyctl: Move UI related calls out of util.prosodyctl
I think this follows the general separation of duties between prosodyctl and util.prosodyctl better.
-rwxr-xr-xprosodyctl5
-rw-r--r--util/prosodyctl.lua8
2 files changed, 5 insertions, 8 deletions
diff --git a/prosodyctl b/prosodyctl
index aa1bc2d9..bec35ed8 100755
--- a/prosodyctl
+++ b/prosodyctl
@@ -78,8 +78,12 @@ function commands.install(arg)
show_usage([[install]], [[Installs a prosody/luarocks plugin]]);
return 1;
end
+ show_message("Installing %s in %s", arg[1], prosody.paths.installer);
-- TODO finalize config option name
local ret = call_luarocks("install", arg[1], configmanager.get("*", "plugin_server") or "http://localhost/");
+ if ret == 0 and operation == "install" then
+ show_module_configuration_help(mod);
+ end
return ret;
end
@@ -88,6 +92,7 @@ function commands.remove(arg)
show_usage([[remove]], [[Removes a module installed in the working directory's plugins folder]]);
return 1;
end
+ show_message("Removing %s from %s", arg[1], prosody.paths.installer);
local ret = call_luarocks("remove", arg[1]);
return ret;
end
diff --git a/util/prosodyctl.lua b/util/prosodyctl.lua
index d53a7ff5..efe3f5f3 100644
--- a/util/prosodyctl.lua
+++ b/util/prosodyctl.lua
@@ -221,11 +221,6 @@ local render_cli = interpolation.new("%b{}", function (s) return "'"..s:gsub("'"
local function call_luarocks(operation, mod, server)
local dir = prosody.paths.installer;
- if operation == "install" then
- show_message("Installing %s in %s", mod, dir);
- elseif operation == "remove" then
- show_message("Removing %s from %s", mod, dir);
- end
local ok, where, code = os.execute(render_cli("luarocks {op} --tree={dir} {server&--server={server}} {mod?}", {
dir = dir; op = operation; mod = mod; server = server;
}));
@@ -233,9 +228,6 @@ local function call_luarocks(operation, mod, server)
if not ok then
return code;
end
- if operation == "install" then
- show_module_configuration_help(mod);
- end
return true;
end