# HG changeset patch
# User Kim Alvefur <zash@zash.se>
# Date 1611252687 -3600
# Node ID 50ea7d9143ada1bfc137cd4e7e413d86b3b57dc4
# Parent  a1939b261f6781f10c2dfa7158a514aa57cfc5c2
prosodyctl: Abort if no plugin source specified for the installer

Better than having a non-working default.

diff -r a1939b261f67 -r 50ea7d9143ad prosodyctl
--- a/prosodyctl	Thu Jan 21 19:04:57 2021 +0100
+++ b/prosodyctl	Thu Jan 21 19:11:27 2021 +0100
@@ -80,7 +80,13 @@
 	end
 	show_message("Installing %s in %s", arg[1], prosody.paths.installer);
 	-- TODO finalize config option name
-	local ret = call_luarocks("install", arg[1], configmanager.get("*", "plugin_server") or "http://localhost/");
+	local server = configmanager.get("*", "plugin_server");
+	if not server then
+		show_warning("There is no 'plugin_server' option in the configuration file");
+		-- see https://prosody.im/doc/TODO documentation
+		return 1;
+	end
+	local ret = call_luarocks("install", arg[1], server);
 	if ret == 0 and operation == "install" then
 		show_module_configuration_help(mod);
 	end