aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-03-30 12:12:50 +0200
committerKim Alvefur <zash@zash.se>2018-03-30 12:12:50 +0200
commit054e1807e5c7e26e9ec0b3ce762de5a42fb0e651 (patch)
treee0112c0edd4e08b3e455d470acf3f410e93905e9
parent3c8840746319e6e929c8fd3d670d8fb1ac99c767 (diff)
downloadprosody-054e1807e5c7e26e9ec0b3ce762de5a42fb0e651.tar.gz
prosody-054e1807e5c7e26e9ec0b3ce762de5a42fb0e651.zip
prosodyctl: Increase robustness in luarocks version detection (fixes #1003)
-rwxr-xr-xprosodyctl12
1 files changed, 9 insertions, 3 deletions
diff --git a/prosodyctl b/prosodyctl
index d55ff5e7..6a2c3fa6 100755
--- a/prosodyctl
+++ b/prosodyctl
@@ -376,9 +376,15 @@ function commands.about(arg)
print(" "..path);
end
print("");
- local luarocks_status = (pcall(require, "luarocks.loader") and "Installed ("..(package.loaded["luarocks.cfg"].program_version or "2.x+")..")")
- or (pcall(require, "luarocks.require") and "Installed (1.x)")
- or "Not installed";
+ local luarocks_status = "Not installed"
+ if pcall(require, "luarocks.loader") then
+ luarocks_status = "Installed (2.x+)";
+ if package.loaded["luarocks.cfg"] then
+ luarocks_status = "Installed ("..(package.loaded["luarocks.cfg"].program_version or "2.x+")..")";
+ end
+ elseif pcall(require, "luarocks.require") then
+ luarocks_status = "Installed (1.x)";
+ end
print("LuaRocks: ", luarocks_status);
print("");
print("# Lua module versions");