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 | f088ddc713ec2b830b89546a4bf1b6a1218631e4 (patch) | |
tree | 327a1973ed11f0f63a3d5cc21ad2d58fc67f15b6 /util | |
parent | 2af161560a96cf1b69a9d28ee79388c87a1b7418 (diff) | |
download | prosody-f088ddc713ec2b830b89546a4bf1b6a1218631e4.tar.gz prosody-f088ddc713ec2b830b89546a4bf1b6a1218631e4.zip |
util.startup: Now calls a function to complement lua's path/cpath
Diffstat (limited to 'util')
-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 |