diff options
author | João Duarte <jvsDuarte08@gmail.com> | 2019-08-01 04:33:05 -0700 |
---|---|---|
committer | João Duarte <jvsDuarte08@gmail.com> | 2019-08-01 04:33:05 -0700 |
commit | 92fafa3343526ed26f66dc81d26167b7e0850f69 (patch) | |
tree | a95bb573e72ce068ea5fae9602d810f3f60608fb | |
parent | ee4ae338f9f6f4cbb162ff5c77c9873a38be8b33 (diff) | |
download | prosody-92fafa3343526ed26f66dc81d26167b7e0850f69.tar.gz prosody-92fafa3343526ed26f66dc81d26167b7e0850f69.zip |
util.startupt: I'm now using the resolve_relative_path function from util/paths at the setup_plugindir function
-rw-r--r-- | util/startup.lua | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/util/startup.lua b/util/startup.lua index 4601bd85..4b3842bb 100644 --- a/util/startup.lua +++ b/util/startup.lua @@ -238,16 +238,8 @@ function startup.setup_plugindir() CFG_PLUGINDIR = table.concat(custom_plugin_paths, path_sep)..path_sep..(CFG_PLUGINDIR or "plugins"); prosody.paths.plugins = CFG_PLUGINDIR; end - -- Checks if installer_plugin_path is a relative paths and makes it an absolute path - if installer_plugin_path:sub(1,1) ~= "/" then - -- Works fine when executing prosody from source (configure and make only) - -- Probably wont be the best install directory, when using a package installation - local lfs_currentdir = require "lfs".currentdir(); - local current_directory = lfs_currentdir; - -- Some normalization - installer_plugin_path = installer_plugin_path:gsub("^%.%"..dir_sep.."+", ""); - installer_plugin_path = current_directory..dir_sep..installer_plugin_path; - end + local current_directory = require "lfs".currentdir(); + installer_plugin_path = config.resolve_relative_path(current_directory, installer_plugin_path); -- Checking if the folder exists. If it doesn't, we create it, but we need permissions to do so if os.execute('[ -d "'..installer_plugin_path..'" ]') ~= 0 then os.execute("mkdir "..installer_plugin_path); |