# HG changeset patch # User João Duarte # Date 1564596020 25200 # Node ID 85725e11c509cc34263ce9009498798c4fa1c45a # Parent 520e879a40f2324a3ea88e7f497bcde4010ba2a1 util.prosodyctl: Added the execute_command function diff -r 520e879a40f2 -r 85725e11c509 util/prosodyctl.lua --- a/util/prosodyctl.lua Wed Jul 31 10:22:40 2019 -0700 +++ b/util/prosodyctl.lua Wed Jul 31 11:00:20 2019 -0700 @@ -322,6 +322,19 @@ 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 @@ get_path_custom_plugins = get_path_custom_plugins; check_flags = check_flags; call_luarocks = call_luarocks; + execute_command = execute_command; };