diff options
author | Jo?o Duarte <jvsDuarte08@gmail.com> | 2019-08-01 09:22:50 -0700 |
---|---|---|
committer | Jo?o Duarte <jvsDuarte08@gmail.com> | 2019-08-01 09:22:50 -0700 |
commit | 84da5cd3d7c5c1fb2c74cff6044569f0bc03fec4 (patch) | |
tree | 327a1973ed11f0f63a3d5cc21ad2d58fc67f15b6 /util/startup.lua | |
parent | a55f24139e8413ddf71280615253ab62b29e7b51 (diff) | |
download | prosody-84da5cd3d7c5c1fb2c74cff6044569f0bc03fec4.tar.gz prosody-84da5cd3d7c5c1fb2c74cff6044569f0bc03fec4.zip |
util.startup: Now calls a function to complement lua's path/cpath
Diffstat (limited to 'util/startup.lua')
-rw-r--r-- | util/startup.lua | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/util/startup.lua b/util/startup.lua index 6ba81819..e46f98c9 100644 --- a/util/startup.lua +++ b/util/startup.lua @@ -229,7 +229,6 @@ function startup.setup_plugindir() local custom_plugin_paths = config.get("*", "plugin_paths"); local installer_plugin_path = config.get("*", "installer_plugin_path") or "custom_plugins"; local path_sep = package.config:sub(3,3); - local dir_sep = package.config:sub(1,1); if custom_plugin_paths then -- path1;path2;path3;defaultpath... -- luacheck: ignore 111 @@ -237,18 +236,8 @@ function startup.setup_plugindir() prosody.paths.plugins = CFG_PLUGINDIR; end installer_plugin_path = config.resolve_relative_path(require "lfs".currentdir(), installer_plugin_path); - require "lfs".mkdir(installer_plugin_path) - -- Checking for duplicates - -- The commands using luarocks need the path to the directory that has the /share and /lib folders. - local lua_version = _VERSION:match(" (.+)$") - local sub_path = dir_sep.."lua"..dir_sep..lua_version..dir_sep - if not string.match(package.path, installer_plugin_path) then - package.path = package.path..path_sep..installer_plugin_path..dir_sep.."share"..sub_path.."?.lua"; - package.path = package.path..path_sep..installer_plugin_path..dir_sep.."share"..sub_path.."?"..dir_sep.."init.lua"; - end - if not string.match(package.path, installer_plugin_path) then - package.cpath = package.cpath..path_sep..installer_plugin_path..dir_sep.."lib"..sub_path.."?.lua"; - end + require "lfs".mkdir(installer_plugin_path); + config.complement_lua_path(installer_plugin_path); CFG_PLUGINDIR = installer_plugin_path..path_sep..(CFG_PLUGINDIR or "plugins"); prosody.paths.plugins = CFG_PLUGINDIR; end |