diff options
author | Matthew Wild <mwild1@gmail.com> | 2025-01-08 20:37:35 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2025-01-08 20:37:35 +0000 |
commit | 26eeda9ed699461c88e20623848142255cf2dbc8 (patch) | |
tree | 01785489632abe0aeac27abaa7120058d7597518 | |
parent | d2b632dffc33d9cef077c12e4631c8e3d0ce869e (diff) | |
download | prosody-26eeda9ed699461c88e20623848142255cf2dbc8.tar.gz prosody-26eeda9ed699461c88e20623848142255cf2dbc8.zip |
prosodyctl: Add lua_paths command to print the LUA_PATH and LUA_CPATH used
This can be useful to run scripts and stuff with access to the same Lua paths
as Prosody uses.
-rwxr-xr-x | prosodyctl | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -486,6 +486,15 @@ function commands.version(arg) print("Prosody "..(prosody.version or "(unknown version)")); end +function commands.lua_paths() + local function shell_escape(s) + return "'" .. tostring(s):gsub("'",[['\'']]) .. "'"; + end + + print("LUA_PATH="..shell_escape(package.path)); + print("LUA_CPATH="..shell_escape(package.cpath)); +end + function commands.reload(arg) local opts = parse_args(arg, only_help); if opts.help then |