Changeset

11134:3e3f22043552

util.prosodyctl: Move hardcoded luarocks server into prosodyctl To be replaced with config option in future commit
author Kim Alvefur <zash@zash.se>
date Mon, 05 Oct 2020 21:24:07 +0200
parents 11133:624eafed3343
children 11135:56490ffde93f
files prosodyctl util/prosodyctl.lua
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/prosodyctl	Mon Oct 05 21:17:29 2020 +0200
+++ b/prosodyctl	Mon Oct 05 21:24:07 2020 +0200
@@ -78,7 +78,7 @@
 		show_usage([[install]], [[Installs a prosody/luarocks plugin]]);
 		return 1;
 	end
-	call_luarocks("install", arg[1]);
+	call_luarocks("install", arg[1], "http://localhost/");
 end
 
 function commands.remove(arg)
--- a/util/prosodyctl.lua	Mon Oct 05 21:17:29 2020 +0200
+++ b/util/prosodyctl.lua	Mon Oct 05 21:24:07 2020 +0200
@@ -227,7 +227,7 @@
 
 local render_cli = interpolation.new("%b{}", function (s) return "'"..s:gsub("'","'\\''").."'" end)
 
-local function call_luarocks(operation, mod)
+local function call_luarocks(operation, mod, server)
 	local dir = get_path_custom_plugins(prosody.paths.plugins);
 	if operation == "install" then
 		show_message("Installing %s at %s", mod, dir);
@@ -238,7 +238,7 @@
 		os.execute(render_cli("luarocks list --tree={dir}", {dir = dir}));
 	else
 		os.execute(render_cli("luarocks {op} --tree={dir} {server&--server={server}} {mod}", {
-					dir = dir; op = operation; mod = mod; server = "http://localhost/";
+					dir = dir; op = operation; mod = mod; server = server;
 			}));
 	end
 	if operation == "install" then