Software / code / prosody
Comparison
prosodyctl @ 11300:d0d64655e584
prosodyctl: Move message after condition
If the condition is false, the message becomes a lie!
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Thu, 21 Jan 2021 19:20:08 +0100 |
| parent | 11297:2e9d4c517919 |
| child | 11301:d7f0dc727a47 |
comparison
equal
deleted
inserted
replaced
| 11299:abe8cd8fad14 | 11300:d0d64655e584 |
|---|---|
| 76 function commands.install(arg) | 76 function commands.install(arg) |
| 77 if arg[1] == "--help" then | 77 if arg[1] == "--help" then |
| 78 show_usage([[install]], [[Installs a prosody/luarocks plugin]]); | 78 show_usage([[install]], [[Installs a prosody/luarocks plugin]]); |
| 79 return 1; | 79 return 1; |
| 80 end | 80 end |
| 81 show_message("Installing %s in %s", arg[1], prosody.paths.installer); | |
| 82 -- TODO finalize config option name | 81 -- TODO finalize config option name |
| 83 local server = configmanager.get("*", "plugin_server"); | 82 local server = configmanager.get("*", "plugin_server"); |
| 84 if not server then | 83 if not server then |
| 85 show_warning("There is no 'plugin_server' option in the configuration file"); | 84 show_warning("There is no 'plugin_server' option in the configuration file"); |
| 86 -- see https://prosody.im/doc/TODO documentation | 85 -- see https://prosody.im/doc/TODO documentation |
| 87 return 1; | 86 return 1; |
| 88 end | 87 end |
| 88 show_message("Installing %s in %s", arg[1], prosody.paths.installer); | |
| 89 local ret = call_luarocks("install", arg[1], server); | 89 local ret = call_luarocks("install", arg[1], server); |
| 90 if ret == 0 then | 90 if ret == 0 then |
| 91 prosodyctl.show_module_configuration_help(arg[1]); | 91 prosodyctl.show_module_configuration_help(arg[1]); |
| 92 end | 92 end |
| 93 return ret; | 93 return ret; |