aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoão Duarte <jvsDuarte08@gmail.com>2019-07-31 11:00:20 -0700
committerJoão Duarte <jvsDuarte08@gmail.com>2019-07-31 11:00:20 -0700
commit2049e20696aecd37419fafb8b38c96550b04a442 (patch)
treec5164debc12ffe1869a011ee6ba928cab40b23e6
parent849165ba69da619e45f7d4da5e0ae2554cea35a7 (diff)
downloadprosody-2049e20696aecd37419fafb8b38c96550b04a442.tar.gz
prosody-2049e20696aecd37419fafb8b38c96550b04a442.zip
util.prosodyctl: Added the execute_command function
-rw-r--r--util/prosodyctl.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/util/prosodyctl.lua b/util/prosodyctl.lua
index 7fe87dab..274d611c 100644
--- a/util/prosodyctl.lua
+++ b/util/prosodyctl.lua
@@ -322,6 +322,19 @@ local function call_luarocks(operation, mod, dir)
end
end
+local function execute_command(arg)
+ local operation = arg[#arg]
+ local tree, mod, dir = check_flags(arg);
+ if tree then
+ call_luarocks(operation, mod, dir);
+ return 0;
+ else
+ dir = get_path_custom_plugins(prosody.paths.plugins);
+ call_luarocks(operation, mod, dir);
+ return 0;
+ end
+end
+
return {
show_message = show_message;
show_warning = show_message;
@@ -345,4 +358,5 @@ return {
get_path_custom_plugins = get_path_custom_plugins;
check_flags = check_flags;
call_luarocks = call_luarocks;
+ execute_command = execute_command;
};