# HG changeset patch # User João Duarte # Date 1563360326 25200 # Node ID a099bff1842daa334fb720e0d1d18790a2539b92 # Parent 1e192e8d4e9d41d30717dc056a795b2325f8810a prosodyctl: The 'install' command can now recognize the flag '--tree' diff -r 1e192e8d4e9d -r a099bff1842d prosodyctl --- a/prosodyctl Wed Jul 17 03:31:02 2019 -0700 +++ b/prosodyctl Wed Jul 17 03:45:26 2019 -0700 @@ -158,9 +158,20 @@ show_usage([[make]], [[Installs a rockspec/rock from a specified server]]); return 1 end - print("Installing module "..arg[1].." locally, from luarocks repo") - os.execute("luarocks --tree='./plugins' install "..arg[1]) - return 0 + -- Need to think about the case with many flags + local flag = "--tree=" + -- I'm considering the flag is the first, but there can be many flags + if arg[1] and arg[1]:sub(1, #flag) == flag then + local dir = arg[1]:match("=(.+)$") + print("Installing module "..arg[2].." at "..dir..", from luarocks repo") + -- These extra double brackets allow us to correctly process names with spaces + os.execute("luarocks install --tree='"..dir.."' "..arg[2]) + return 0; + else + print("Installing module "..arg[1].." locally, from luarocks repo") + os.execute("luarocks --tree='"..prosody.paths.plugins.."' install "..arg[1]) + return 0 + end end function commands.list(arg)