prosodyctl: Pass server when listing (outdated) plugins (fix #1738) 0.12
authorKim Alvefur <zash@zash.se>
Tue, 05 Apr 2022 14:27:37 +0200
branch0.12
changeset 12456 c475a7802169
parent 12454 7efd4bcaa95c
child 12457 1ec4a3a61cf7
child 12458 b2438f374b3e
prosodyctl: Pass server when listing (outdated) plugins (fix #1738) Needed since it checks the manifest of the repository and most likely defaults to luarocks.org unless specified
prosodyctl
--- a/prosodyctl	Mon Apr 04 18:44:57 2022 +0200
+++ b/prosodyctl	Tue Apr 05 14:27:37 2022 +0200
@@ -115,11 +115,17 @@
 		show_usage([[list]], [[Shows installed rocks]]);
 		return 0;
 	end
+	local server = opts.server or configmanager.get("*", "plugin_server");
 	if opts.outdated then
 		-- put this back for luarocks
 		arg[1] = "--outdated";
+
+		if not server then
+			show_warning("There is no 'plugin_server' option in the configuration file, but this is needed for 'list --outdated' to work.");
+			return 1;
+		end
 	end
-	local ret = call_luarocks("list", arg[1]);
+	local ret = call_luarocks("list", arg[1], server);
 	return ret;
 end