Comparison

prosodyctl @ 10153:a88fd34246bd

prosodyctl: The install command now prints output regarding module configuration
author João Duarte <jvsDuarte08@gmail.com>
date Tue, 23 Jul 2019 10:26:00 -0700
parent 10151:e58034955002
child 10154:ad081451291f
comparison
equal deleted inserted replaced
10152:7e9c30eab11e 10153:a88fd34246bd
74 local show_message, show_warning = prosodyctl.show_message, prosodyctl.show_warning; 74 local show_message, show_warning = prosodyctl.show_message, prosodyctl.show_warning;
75 local show_usage = prosodyctl.show_usage; 75 local show_usage = prosodyctl.show_usage;
76 local show_yesno = prosodyctl.show_yesno; 76 local show_yesno = prosodyctl.show_yesno;
77 local show_prompt = prosodyctl.show_prompt; 77 local show_prompt = prosodyctl.show_prompt;
78 local read_password = prosodyctl.read_password; 78 local read_password = prosodyctl.read_password;
79 local show_module_configuration_help = prosodyctl.show_module_configuration_help;
79 80
80 local jid_split = require "util.jid".prepped_split; 81 local jid_split = require "util.jid".prepped_split;
81 82
82 local prosodyctl_timeout = (configmanager.get("*", "prosodyctl_timeout") or 5) * 2; 83 local prosodyctl_timeout = (configmanager.get("*", "prosodyctl_timeout") or 5) * 2;
83 ----------------------- 84 -----------------------
174 if arg[1] and arg[1]:sub(1, #flag) == flag then 175 if arg[1] and arg[1]:sub(1, #flag) == flag then
175 local dir = arg[1]:match("=(.+)$") 176 local dir = arg[1]:match("=(.+)$")
176 print("Installing module "..arg[2].." at "..dir) 177 print("Installing module "..arg[2].." at "..dir)
177 -- These extra double brackets allow us to correctly process names with spaces 178 -- These extra double brackets allow us to correctly process names with spaces
178 os.execute("luarocks --tree='"..dir.."' --server='http://localhost/' install "..arg[2]) 179 os.execute("luarocks --tree='"..dir.."' --server='http://localhost/' install "..arg[2])
180 show_module_configuration_help(arg[2]);
179 return 0; 181 return 0;
180 else 182 else
181 print("Installing module "..arg[1].." at "..prosody.paths.plugins) 183 print("Installing module "..arg[1].." at "..prosody.paths.plugins)
182 -- I've build a local server to upload some new rockspecs, like mod_smacks'. We can replace this server by one from 184 -- I've build a local server to upload some new rockspecs, like mod_smacks'. We can replace this server by one from
183 -- prosody's, where we can oficially disbrute rocks/rockspecs for all modules 185 -- prosody's, where we can oficially disbrute rocks/rockspecs for all modules
184 os.execute("luarocks --tree='"..prosody.paths.plugins.."' --server='http://localhost/' install "..arg[1]) 186 os.execute("luarocks --tree='"..prosody.paths.plugins.."' --server='http://localhost/' install "..arg[1])
187 show_module_configuration_help(arg[1]);
185 return 0; 188 return 0;
186 end 189 end
187 end 190 end
188 191
189 function commands.list(arg) 192 function commands.list(arg)