Diff

prosodyctl @ 10178:badc8610bfdf

prosodyctl: Swapped prints for the show_message function at the install/remove commands
author João Duarte <jvsDuarte08@gmail.com>
date Wed, 31 Jul 2019 05:47:36 -0700
parent 10172:5da519ef2d51
child 10179:2364e9533d0e
line wrap: on
line diff
--- a/prosodyctl	Mon Jul 29 10:32:03 2019 -0700
+++ b/prosodyctl	Wed Jul 31 05:47:36 2019 -0700
@@ -95,12 +95,12 @@
 	local flag = "--tree="
 	if arg[1] and arg[1]:sub(1, #flag) == flag then
 		local dir = arg[1]:match("=(.+)$")
-		print("Installing module "..arg[2].." at "..dir)
+		show_message("Installing module %s at %s", arg[2], dir)
 		os.execute("luarocks --tree='"..dir.."' --server='http://localhost/' install "..arg[2])
 		show_module_configuration_help(arg[2]);
 		return 0;
 	else
-		print("Installing module "..arg[1].." at "..installer_plugin_path)
+		show_message("Installing module %s at %s", arg[1], installer_plugin_path)
 		-- 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='"..installer_plugin_path.."' --server='http://localhost/' install "..arg[1])
@@ -120,13 +120,12 @@
 	-- I'm considering this optional flag comes first
 	if arg[1] and arg[1]:sub(1, #flag) == flag then
 		local dir = arg[1]:match("=(.+)$")
-		print("Removing module "..arg[2].." at "..dir)
+		show_message("Removing module %s at %s", arg[2], dir)
 		os.execute("luarocks remove --tree='"..dir.."' "..arg[2])
 		return 0;
 	else
-		print("Removing "..arg[1].." from "..installer_plugin_path)
+		show_message("Removing %s from %s", arg[1], installer_plugin_path)
 		os.execute("luarocks --tree='"..installer_plugin_path.."' remove "..arg[1])
-		print("Done!")
 		return 0;
 	end
 end