aboutsummaryrefslogtreecommitdiffstats
path: root/util/startup.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-01-24 16:12:53 +0100
committerKim Alvefur <zash@zash.se>2021-01-24 16:12:53 +0100
commit48bc14c169c1267bbdc18cd66a63b73b1c6efb20 (patch)
treea04b4644d2fff04752fa80af3f58771210644973 /util/startup.lua
parent27c7ee73b702c60c4496c5507dbc581b9a13a7bf (diff)
downloadprosody-48bc14c169c1267bbdc18cd66a63b73b1c6efb20.tar.gz
prosody-48bc14c169c1267bbdc18cd66a63b73b1c6efb20.zip
util.startup: Make installer_plugin_path relative to data directory
Having it relative to current working directory is problematic since this depends on how Prosody was started and changes to the data directory during startup (but after this point).
Diffstat (limited to 'util/startup.lua')
-rw-r--r--util/startup.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/util/startup.lua b/util/startup.lua
index d6e7eca1..11225290 100644
--- a/util/startup.lua
+++ b/util/startup.lua
@@ -267,10 +267,9 @@ function startup.setup_plugindir()
end
function startup.setup_plugin_install_path()
- local installer_plugin_path = config.get("*", "installer_plugin_path") or (CFG_DATADIR or "data").."/custom_plugins";
+ local installer_plugin_path = config.get("*", "installer_plugin_path") or "custom_plugins";
local path_sep = package.config:sub(3,3);
- -- TODO Figure out what this should be relative to, because CWD could be anywhere
- installer_plugin_path = config.resolve_relative_path(require "lfs".currentdir(), installer_plugin_path);
+ installer_plugin_path = config.resolve_relative_path(CFG_DATADIR or "data", installer_plugin_path);
require"util.paths".complement_lua_path(installer_plugin_path);
-- luacheck: ignore 111
CFG_PLUGINDIR = installer_plugin_path..path_sep..(CFG_PLUGINDIR or "plugins");