# HG changeset patch # User João Duarte # Date 1559908840 -3600 # Node ID 5a3611218709917a085ca8b65294cb3c304aa6b8 # Parent 5d132d4aac554d82407449e51838ad8c3723f152 prosodyctl: Added the 'local_plugins' command function, which prints back a list of locally available plugins diff -r 5d132d4aac55 -r 5a3611218709 prosodyctl --- a/prosodyctl Fri Jun 07 11:46:19 2019 +0100 +++ b/prosodyctl Fri Jun 07 13:00:40 2019 +0100 @@ -87,10 +87,25 @@ function commands.test() show_message [[Well, hello there!]] - --show_message [[Enabled Plugins: ], modulemanager.get_modules_for_host()] show_warning("Trying to peek at the plugin directory: '%s'", modulemanager.get_modules_for_host()) end +function commands.local_plugins() + local directory = "./plugins" + local i, t, popen = 0, {}, io.popen + local pfile = popen('ls -a "'..directory..'"') + for filename in pfile:lines() do + if filename == "." or filename == ".." then + i = i + 1 + else + i = i + 1 + t[i] = filename + show_warning("%s", t[i]) + end + end + pfile:close() +end + function commands.adduser(arg) if not arg[1] or arg[1] == "--help" then show_usage([[adduser JID]], [[Create the specified user account in Prosody]]);