aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoão Duarte <jvsDuarte08@gmail.com>2019-07-31 10:22:40 -0700
committerJoão Duarte <jvsDuarte08@gmail.com>2019-07-31 10:22:40 -0700
commit849165ba69da619e45f7d4da5e0ae2554cea35a7 (patch)
tree4d565362178568aeaf05466d8f73e9a3bd2642b2
parent2b8e9031a41af9046dc19c35e95f8cac0b4e67b1 (diff)
downloadprosody-849165ba69da619e45f7d4da5e0ae2554cea35a7.tar.gz
prosody-849165ba69da619e45f7d4da5e0ae2554cea35a7.zip
prosodyctl: Rewrote the list command, to make it cleaner and easier to work with
-rwxr-xr-xprosodyctl14
1 files changed, 6 insertions, 8 deletions
diff --git a/prosodyctl b/prosodyctl
index b92b166b..c0690293 100755
--- a/prosodyctl
+++ b/prosodyctl
@@ -126,16 +126,14 @@ function commands.list(arg)
show_usage([[list]], [[Shows installed rocks]]);
return 1;
end
- -- I'm considering that we are using just one path to custom plugins, and it is the first in prosody.paths.plugins, for now
- 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("=(.+)$")
- os.execute("luarocks list --tree='"..dir.."'")
+ local operation = "list";
+ local tree, mod, dir = check_flags(arg);
+ if tree then
+ call_luarocks(operation, mod, dir);
return 0;
else
- os.execute("luarocks list --tree="..installer_plugin_path)
+ dir = get_path_custom_plugins(prosody.paths.plugins);
+ call_luarocks(operation, mod, dir);
return 0;
end
end