Software /
code /
prosody
Comparison
prosodyctl @ 10166:4d1206ac0d41
prosodyctl: Updated the list command, to use the new directory for custom plugins
author | João Duarte <jvsDuarte08@gmail.com> |
---|---|
date | Wed, 24 Jul 2019 10:48:20 -0700 |
parent | 10165:8fd6fb34d9c5 |
child | 10168:f365f814d641 |
comparison
equal
deleted
inserted
replaced
10165:8fd6fb34d9c5 | 10166:4d1206ac0d41 |
---|---|
142 function commands.list(arg) | 142 function commands.list(arg) |
143 if arg[1] == "--help" then | 143 if arg[1] == "--help" then |
144 show_usage([[list]], [[Shows installed rocks]]); | 144 show_usage([[list]], [[Shows installed rocks]]); |
145 return 1; | 145 return 1; |
146 end | 146 end |
147 -- I'm considering that we are using just one path to custom plugins, and it is the first in prosody.paths.plugins, for now | |
148 for path in prosody.paths.plugins:gmatch("[^;]+") do | |
149 installer_plugin_path = path | |
150 break | |
151 end | |
147 local flag = "--tree=" | 152 local flag = "--tree=" |
148 -- I'm considering this optional flag comes first | 153 -- I'm considering this optional flag comes first |
149 if arg[1] and arg[1]:sub(1, #flag) == flag then | 154 if arg[1] and arg[1]:sub(1, #flag) == flag then |
150 local dir = arg[1]:match("=(.+)$") | 155 local dir = arg[1]:match("=(.+)$") |
151 os.execute("luarocks list --tree='"..dir.."'") | 156 os.execute("luarocks list --tree='"..dir.."'") |
152 return 0; | 157 return 0; |
153 else | 158 else |
154 os.execute("luarocks list --tree="..prosody.paths.plugins) | 159 os.execute("luarocks list --tree="..installer_plugin_path) |
155 return 0; | 160 return 0; |
156 end | 161 end |
157 end | 162 end |
158 | 163 |
159 function commands.enabled_plugins(arg) | 164 function commands.enabled_plugins(arg) |