aboutsummaryrefslogtreecommitdiffstats
path: root/prosodyctl
diff options
context:
space:
mode:
authorJoão Duarte <jvsDuarte08@gmail.com>2019-07-24 05:01:35 -0700
committerJoão Duarte <jvsDuarte08@gmail.com>2019-07-24 05:01:35 -0700
commitf736aec6b2c3062216b6f7481bd80a2444ffc36f (patch)
tree6f46796ad2e112be3ad2eed9aac206ea6c5232bc /prosodyctl
parente1969065c487c60fa6df682d2aca5614d2dae690 (diff)
downloadprosody-f736aec6b2c3062216b6f7481bd80a2444ffc36f.tar.gz
prosody-f736aec6b2c3062216b6f7481bd80a2444ffc36f.zip
prosodyctl: Corrected the remove and install commands' order
Diffstat (limited to 'prosodyctl')
-rwxr-xr-xprosodyctl40
1 files changed, 20 insertions, 20 deletions
diff --git a/prosodyctl b/prosodyctl
index 905e00cf..2fd3084d 100755
--- a/prosodyctl
+++ b/prosodyctl
@@ -85,50 +85,50 @@ local prosodyctl_timeout = (configmanager.get("*", "prosodyctl_timeout") or 5) *
local commands = {};
local command = table.remove(arg, 1);
--- Command to remove a rockspec
--- Receives as an argument the name of the plugin to be removed from the plugins folder
-function commands.remove(arg)
+function commands.install(arg)
if arg[1] == "--help" then
- show_usage([[make]], [[Removes a module installed in the wroking directory's plugins folder]]);
+ show_usage([[make]], [[Installs a prosody/luarocks plugin]]);
return 1;
end
+ -- Need to think about the case with many flags
local flag = "--tree="
-- I'm considering the flag is the first, but there can be many flags
if arg[1] and arg[1]:sub(1, #flag) == flag then
local dir = arg[1]:match("=(.+)$")
- print("Removing module "..arg[2].." at "..dir)
+ print("Installing module "..arg[2].." at "..dir)
-- These extra double brackets allow us to correctly process names with spaces
- os.execute("luarocks remove --tree='"..dir.."' "..arg[2])
+ os.execute("luarocks --tree='"..dir.."' --server='http://localhost/' install "..arg[2])
+ show_module_configuration_help(arg[2]);
return 0;
else
- print("Removing "..arg[1].." from "..prosody.paths.plugins)
- os.execute("luarocks --tree='"..prosody.paths.plugins.."' remove "..arg[1])
- print("Done!")
+ print("Installing module "..arg[1].." at "..prosody.paths.plugins)
+ -- I've build a local server to upload some new rockspecs, like mod_smacks'. We can replace this server by one from
+ -- prosody's, where we can oficially disbrute rocks/rockspecs for all modules
+ os.execute("luarocks --tree='"..prosody.paths.plugins.."' --server='http://localhost/' install "..arg[1])
+ show_module_configuration_help(arg[1]);
return 0;
end
end
-function commands.install(arg)
+-- Command to remove a rockspec
+-- Receives as an argument the name of the plugin to be removed from the plugins folder
+function commands.remove(arg)
if arg[1] == "--help" then
- show_usage([[make]], [[Installs a prosody/luarocks plugin]]);
+ show_usage([[make]], [[Removes a module installed in the wroking directory's plugins folder]]);
return 1;
end
- -- Need to think about the case with many flags
local flag = "--tree="
-- I'm considering the flag is the first, but there can be many flags
if arg[1] and arg[1]:sub(1, #flag) == flag then
local dir = arg[1]:match("=(.+)$")
- print("Installing module "..arg[2].." at "..dir)
+ print("Removing module "..arg[2].." at "..dir)
-- These extra double brackets allow us to correctly process names with spaces
- os.execute("luarocks --tree='"..dir.."' --server='http://localhost/' install "..arg[2])
- show_module_configuration_help(arg[2]);
+ os.execute("luarocks remove --tree='"..dir.."' "..arg[2])
return 0;
else
- print("Installing module "..arg[1].." at "..prosody.paths.plugins)
- -- I've build a local server to upload some new rockspecs, like mod_smacks'. We can replace this server by one from
- -- prosody's, where we can oficially disbrute rocks/rockspecs for all modules
- os.execute("luarocks --tree='"..prosody.paths.plugins.."' --server='http://localhost/' install "..arg[1])
- show_module_configuration_help(arg[1]);
+ print("Removing "..arg[1].." from "..prosody.paths.plugins)
+ os.execute("luarocks --tree='"..prosody.paths.plugins.."' remove "..arg[1])
+ print("Done!")
return 0;
end
end