238 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"); |
239 prosody.paths.plugins = CFG_PLUGINDIR; |
239 prosody.paths.plugins = CFG_PLUGINDIR; |
240 end |
240 end |
241 local current_directory = require "lfs".currentdir(); |
241 local current_directory = require "lfs".currentdir(); |
242 installer_plugin_path = config.resolve_relative_path(current_directory, installer_plugin_path); |
242 installer_plugin_path = config.resolve_relative_path(current_directory, installer_plugin_path); |
243 -- Checking if the folder exists. If it doesn't, we create it, but we need permissions to do so |
243 require "lfs".mkdir(installer_plugin_path) |
244 if os.execute('[ -d "'..installer_plugin_path..'" ]') ~= 0 then |
|
245 os.execute("mkdir "..installer_plugin_path); |
|
246 end |
|
247 -- Developers may have add these custom paths to their LUA_PATH/LUA_CPATH variables, before running prosody |
244 -- Developers may have add these custom paths to their LUA_PATH/LUA_CPATH variables, before running prosody |
248 -- Therefore, I'll just check if the paths we are about to add aren't already at package.(path/cpath) |
245 -- Therefore, I'll just check if the paths we are about to add aren't already at package.(path/cpath) |
249 if not string.match(package.path, installer_plugin_path) then |
246 if not string.match(package.path, installer_plugin_path) then |
250 local lua_version = _VERSION:match(" (.+)$") |
247 local lua_version = _VERSION:match(" (.+)$") |
251 -- I'm assuming there's good reason not to hard code any separator |
248 -- I'm assuming there's good reason not to hard code any separator |