Comparison

prosodyctl @ 10157:c6e166272d94

prosodyctl: Removed the make, admin_add and admin_remove commands
author João Duarte <jvsDuarte08@gmail.com>
date Wed, 24 Jul 2019 04:42:45 -0700
parent 10155:ebe39918d430
child 10159:2eabac18e3dc
comparison
equal deleted inserted replaced
10156:1797e2e22a38 10157:c6e166272d94
82 82
83 local prosodyctl_timeout = (configmanager.get("*", "prosodyctl_timeout") or 5) * 2; 83 local prosodyctl_timeout = (configmanager.get("*", "prosodyctl_timeout") or 5) * 2;
84 ----------------------- 84 -----------------------
85 local commands = {}; 85 local commands = {};
86 local command = table.remove(arg, 1); 86 local command = table.remove(arg, 1);
87
88 -- Command to install a rockspec with local sources
89 -- The module is installed at the plugins folder
90 function commands.make(arg)
91 if arg[1] == "--help" then
92 show_usage([[make]], [[Installs a module with sources available locally]]);
93 return 1;
94 end
95 os.execute("cd downloaded_modules/"..arg[1].." && luarocks --tree='../../plugins' make "..arg[1].."-scm-1.rockspec")
96 return 0;
97 end
98 87
99 -- Command to remove a rockspec 88 -- Command to remove a rockspec
100 -- Receives as an argument the name of the plugin to be removed from the plugins folder 89 -- Receives as an argument the name of the plugin to be removed from the plugins folder
101 function commands.remove(arg) 90 function commands.remove(arg)
102 if arg[1] == "--help" then 91 if arg[1] == "--help" then
159 return 0; 148 return 0;
160 else 149 else
161 os.execute("luarocks list --tree="..prosody.paths.plugins) 150 os.execute("luarocks list --tree="..prosody.paths.plugins)
162 return 0; 151 return 0;
163 end 152 end
164 end
165
166 function commands.admin_add(arg)
167 prosodyctl.admin_operation("add ", arg)
168 return 0;
169 end
170
171 function commands.admin_remove(arg)
172 prosodyctl.admin_operation("remove ", arg)
173 return 0;
174 end 153 end
175 154
176 function commands.enabled_plugins(arg) 155 function commands.enabled_plugins(arg)
177 if arg[1] == "--help" then 156 if arg[1] == "--help" then
178 show_usage([[enabled_plugins]], [[Shows plugins currently enabled on prosody]]); 157 show_usage([[enabled_plugins]], [[Shows plugins currently enabled on prosody]]);