Comparison

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
comparison
equal deleted inserted replaced
10186:520e879a40f2 10187:85725e11c509
317 else 317 else
318 os.execute("luarocks --tree='"..dir.."' --server='http://localhost/' "..operation.." "..mod); 318 os.execute("luarocks --tree='"..dir.."' --server='http://localhost/' "..operation.." "..mod);
319 end 319 end
320 if operation == "install" then 320 if operation == "install" then
321 show_module_configuration_help(mod); 321 show_module_configuration_help(mod);
322 end
323 end
324
325 local function execute_command(arg)
326 local operation = arg[#arg]
327 local tree, mod, dir = check_flags(arg);
328 if tree then
329 call_luarocks(operation, mod, dir);
330 return 0;
331 else
332 dir = get_path_custom_plugins(prosody.paths.plugins);
333 call_luarocks(operation, mod, dir);
334 return 0;
322 end 335 end
323 end 336 end
324 337
325 return { 338 return {
326 show_message = show_message; 339 show_message = show_message;
343 stop = stop; 356 stop = stop;
344 reload = reload; 357 reload = reload;
345 get_path_custom_plugins = get_path_custom_plugins; 358 get_path_custom_plugins = get_path_custom_plugins;
346 check_flags = check_flags; 359 check_flags = check_flags;
347 call_luarocks = call_luarocks; 360 call_luarocks = call_luarocks;
361 execute_command = execute_command;
348 }; 362 };