Software / code / prosody
Comparison
prosodyctl @ 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 |
| parent | 13609:c0b6b6a12228 |
| child | 13612:8617f5962e47 |
comparison
equal
deleted
inserted
replaced
| 13609:c0b6b6a12228 | 13610:ff0f4d1f16c8 |
|---|---|
| 484 end | 484 end |
| 485 | 485 |
| 486 print("Prosody "..(prosody.version or "(unknown version)")); | 486 print("Prosody "..(prosody.version or "(unknown version)")); |
| 487 end | 487 end |
| 488 | 488 |
| 489 function commands.lua_paths() | |
| 490 local function shell_escape(s) | |
| 491 return "'" .. tostring(s):gsub("'",[['\'']]) .. "'"; | |
| 492 end | |
| 493 | |
| 494 print("LUA_PATH="..shell_escape(package.path)); | |
| 495 print("LUA_CPATH="..shell_escape(package.cpath)); | |
| 496 end | |
| 497 | |
| 489 function commands.reload(arg) | 498 function commands.reload(arg) |
| 490 local opts = parse_args(arg, only_help); | 499 local opts = parse_args(arg, only_help); |
| 491 if opts.help then | 500 if opts.help then |
| 492 show_usage([[reload]], [[Reload Prosody's configuration and re-open log files]]); | 501 show_usage([[reload]], [[Reload Prosody's configuration and re-open log files]]); |
| 493 return 0; | 502 return 0; |