From 26eeda9ed699461c88e20623848142255cf2dbc8 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Wed, 8 Jan 2025 20:37:35 +0000 Subject: 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. --- prosodyctl | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'prosodyctl') 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 -- cgit v1.2.3