Comparison

util/startup.lua @ 11139:2187643b8e20

util.startup: Fix startup failure if CFG_DATADIR is unset As is normal when running from source
author Kim Alvefur <zash@zash.se>
date Mon, 05 Oct 2020 21:54:17 +0200
parent 11138:2a19d61f4ae4
child 11144:2b9f7c537acb
comparison
equal deleted inserted replaced
11138:2a19d61f4ae4 11139:2187643b8e20
258 prosody.paths.plugins = CFG_PLUGINDIR; 258 prosody.paths.plugins = CFG_PLUGINDIR;
259 end 259 end
260 end 260 end
261 261
262 function startup.setup_plugin_install_path() 262 function startup.setup_plugin_install_path()
263 local installer_plugin_path = config.get("*", "installer_plugin_path") or CFG_DATADIR.."/custom_plugins"; 263 local installer_plugin_path = config.get("*", "installer_plugin_path") or (CFG_DATADIR or "data").."/custom_plugins";
264 local path_sep = package.config:sub(3,3); 264 local path_sep = package.config:sub(3,3);
265 -- TODO Figure out what this should be relative to, because CWD could be anywhere 265 -- TODO Figure out what this should be relative to, because CWD could be anywhere
266 installer_plugin_path = config.resolve_relative_path(require "lfs".currentdir(), installer_plugin_path); 266 installer_plugin_path = config.resolve_relative_path(require "lfs".currentdir(), installer_plugin_path);
267 -- TODO Can probably move directory creation to the install command 267 -- TODO Can probably move directory creation to the install command
268 require "lfs".mkdir(installer_plugin_path); 268 require "lfs".mkdir(installer_plugin_path);