diff options
author | Kim Alvefur <zash@zash.se> | 2018-03-30 12:12:50 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-03-30 12:12:50 +0200 |
commit | 574ae71c70e6d775bd0ef735b2c0f84addc23f95 (patch) | |
tree | e0112c0edd4e08b3e455d470acf3f410e93905e9 /prosodyctl | |
parent | 9974612a934f22f94bf8ce57002a3a192c1dd5c1 (diff) | |
download | prosody-574ae71c70e6d775bd0ef735b2c0f84addc23f95.tar.gz prosody-574ae71c70e6d775bd0ef735b2c0f84addc23f95.zip |
prosodyctl: Increase robustness in luarocks version detection (fixes #1003)
Diffstat (limited to 'prosodyctl')
-rwxr-xr-x | prosodyctl | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -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"); |