Software /
code /
prosody
Diff
util/prosodyctl.lua @ 10187:85725e11c509
util.prosodyctl: Added the execute_command function
author | João Duarte <jvsDuarte08@gmail.com> |
---|---|
date | Wed, 31 Jul 2019 11:00:20 -0700 |
parent | 10185:02d8f475a96d |
child | 10189:d311168c71d1 |
line wrap: on
line diff
--- 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; };