Software /
code /
prosody
Changeset
13610:ff0f4d1f16c8
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.
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 08 Jan 2025 20:37:35 +0000 |
parents | 13609:c0b6b6a12228 |
children | 13611:3a23116cf063 |
files | prosodyctl |
diffstat | 1 files changed, 9 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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