aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-01-21 19:11:27 +0100
committerKim Alvefur <zash@zash.se>2021-01-21 19:11:27 +0100
commitea529c8062f704c4a8fbc2ae95bddc4302c9c507 (patch)
tree968efbf77e9d0569ed209902d3a0afd6a09394e9
parentbd62b3bce705d2672dd32ac72f4717cf215dbd29 (diff)
downloadprosody-ea529c8062f704c4a8fbc2ae95bddc4302c9c507.tar.gz
prosody-ea529c8062f704c4a8fbc2ae95bddc4302c9c507.zip
prosodyctl: Abort if no plugin source specified for the installer
Better than having a non-working default.
-rwxr-xr-xprosodyctl8
1 files changed, 7 insertions, 1 deletions
diff --git a/prosodyctl b/prosodyctl
index bec35ed8..37116491 100755
--- a/prosodyctl
+++ b/prosodyctl
@@ -80,7 +80,13 @@ function commands.install(arg)
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