# HG changeset patch # User Matthew Wild # Date 1736368655 0 # Node ID ff0f4d1f16c8311552ee4a0b0f96f5e9b0fa6277 # Parent c0b6b6a12228da2d8b441c2e2f189d89f0635233 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. diff -r c0b6b6a12228 -r ff0f4d1f16c8 prosodyctl --- a/prosodyctl Wed Jan 08 20:35:05 2025 +0000 +++ b/prosodyctl Wed Jan 08 20:37:35 2025 +0000 @@ -486,6 +486,15 @@ 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