aboutsummaryrefslogtreecommitdiffstats
path: root/prosodyctl
diff options
context:
space:
mode:
authorJoão Duarte <jvsDuarte08@gmail.com>2019-07-31 10:07:22 -0700
committerJoão Duarte <jvsDuarte08@gmail.com>2019-07-31 10:07:22 -0700
commitf74f2d0d17b792139c85d44cbb4a64939bd2347e (patch)
tree986348d07d951048bef558a9e7ee3a47ba83a26c /prosodyctl
parent289378113abb5b92d1628369fad66454b58cb738 (diff)
downloadprosody-f74f2d0d17b792139c85d44cbb4a64939bd2347e.tar.gz
prosody-f74f2d0d17b792139c85d44cbb4a64939bd2347e.zip
prosodyctl: Rewrote the remove command, to make it cleaner and easier to work with
Diffstat (limited to 'prosodyctl')
-rwxr-xr-xprosodyctl15
1 files changed, 6 insertions, 9 deletions
diff --git a/prosodyctl b/prosodyctl
index 18db72b7..b92b166b 100755
--- a/prosodyctl
+++ b/prosodyctl
@@ -109,17 +109,14 @@ function commands.remove(arg)
show_usage([[remove]], [[Removes a module installed in the wroking directory's plugins folder]]);
return 1;
end
- local installer_plugin_path = prosodyctl.get_path_custom_plugins(prosody.paths.plugins)
- local flag = "--tree="
- -- I'm considering this optional flag comes first
- if arg[1] and arg[1]:sub(1, #flag) == flag then
- local dir = arg[1]:match("=(.+)$")
- show_message("Removing module %s at %s", arg[2], dir)
- os.execute("luarocks remove --tree='"..dir.."' "..arg[2])
+ local operation = "remove";
+ local tree, mod, dir = check_flags(arg);
+ if tree then
+ call_luarocks(operation, mod, dir);
return 0;
else
- show_message("Removing %s from %s", arg[1], installer_plugin_path)
- os.execute("luarocks --tree='"..installer_plugin_path.."' remove "..arg[1])
+ dir = get_path_custom_plugins(prosody.paths.plugins);
+ call_luarocks(operation, mod, dir);
return 0;
end
end