# HG changeset patch # User Kim Alvefur # Date 1643997782 -3600 # Node ID 24b0c4c4e28a8ccf02e907dd9204c6eac10dc347 # Parent 47d5233a1fc79d7484e3edab2af3953d6dc9bc65 prosodyctl: Allow install plugin via explicit path or URL This way you don't need to set the server URL in the config to use this, you could just ^C^V an install line from a web page that says prosodyctl install https://modules.example.com/mod_example.src.rock Drop the help message in this case since it'll be all messed up by being given an URL or rock filename. diff -r 47d5233a1fc7 -r 24b0c4c4e28a prosodyctl --- a/prosodyctl Fri Feb 04 19:01:34 2022 +0100 +++ b/prosodyctl Fri Feb 04 19:03:02 2022 +0100 @@ -84,7 +84,7 @@ end -- TODO finalize config option name local server = configmanager.get("*", "plugin_server"); - if not server then + if not (arg[1]:match("^https://") or lfs.attributes(arg[1]) or server) then show_warning("There is no 'plugin_server' option in the configuration file"); -- see https://prosody.im/doc/TODO documentation -- #1602 @@ -92,7 +92,7 @@ end show_message("Installing %s in %s", arg[1], prosody.paths.installer); local ret = call_luarocks("install", arg[1], server); - if ret == 0 then + if ret == 0 and arg[1]:match("^mod_") then prosodyctl.show_module_configuration_help(arg[1]); end return ret;