aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2025-01-08 20:37:35 +0000
committerMatthew Wild <mwild1@gmail.com>2025-01-08 20:37:35 +0000
commit26eeda9ed699461c88e20623848142255cf2dbc8 (patch)
tree01785489632abe0aeac27abaa7120058d7597518
parentd2b632dffc33d9cef077c12e4631c8e3d0ce869e (diff)
downloadprosody-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-xprosodyctl9
1 files changed, 9 insertions, 0 deletions
diff --git a/prosodyctl b/prosodyctl
index 6e19170d..9bdc86a2 100755
--- a/prosodyctl
+++ b/prosodyctl
@@ -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