util/startup.lua
changeset 10214 9fdda9fafc3c
parent 10112 659ffa03f1e7
parent 10207 3beb37ed7f32
child 10395 986349fc0f9e
equal deleted inserted replaced
10125:33f287519bf6 10214: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.