Software /
code /
prosody
Comparison
util/startup.lua @ 10210:9fdda9fafc3c
Merge mod-installer (2019 GSoC by João Duarte)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 19 Aug 2019 12:17:17 +0100 |
parent | 10108:659ffa03f1e7 |
parent | 10203:3beb37ed7f32 |
child | 10391:986349fc0f9e |
comparison
equal
deleted
inserted
replaced
10121:33f287519bf6 | 10210:9fdda9fafc3c |
---|---|
225 prosody.paths.data = config.get("*", "data_path") or CFG_DATADIR or "data"; | 225 prosody.paths.data = config.get("*", "data_path") or CFG_DATADIR or "data"; |
226 end | 226 end |
227 | 227 |
228 function startup.setup_plugindir() | 228 function startup.setup_plugindir() |
229 local custom_plugin_paths = config.get("*", "plugin_paths"); | 229 local custom_plugin_paths = config.get("*", "plugin_paths"); |
230 local installer_plugin_path = config.get("*", "installer_plugin_path") or "custom_plugins"; | |
231 local path_sep = package.config:sub(3,3); | |
232 installer_plugin_path = config.resolve_relative_path(require "lfs".currentdir(), installer_plugin_path); | |
233 require "lfs".mkdir(installer_plugin_path); | |
234 require"util.paths".complement_lua_path(installer_plugin_path); | |
230 if custom_plugin_paths then | 235 if custom_plugin_paths then |
231 local path_sep = package.config:sub(3,3); | |
232 -- path1;path2;path3;defaultpath... | 236 -- path1;path2;path3;defaultpath... |
233 -- luacheck: ignore 111 | 237 -- luacheck: ignore 111 |
234 CFG_PLUGINDIR = table.concat(custom_plugin_paths, path_sep)..path_sep..(CFG_PLUGINDIR or "plugins"); | 238 CFG_PLUGINDIR = table.concat(custom_plugin_paths, path_sep)..path_sep..(CFG_PLUGINDIR or "plugins"); |
235 prosody.paths.plugins = CFG_PLUGINDIR; | 239 prosody.paths.plugins = CFG_PLUGINDIR; |
236 end | 240 end |
241 CFG_PLUGINDIR = installer_plugin_path..path_sep..(CFG_PLUGINDIR or "plugins"); | |
242 prosody.paths.plugins = CFG_PLUGINDIR; | |
237 end | 243 end |
238 | 244 |
239 function startup.chdir() | 245 function startup.chdir() |
240 if prosody.installed then | 246 if prosody.installed then |
241 -- Change working directory to data path. | 247 -- Change working directory to data path. |