diff options
author | Jo?o Duarte <jvsDuarte08@gmail.com> | 2019-07-26 08:58:56 -0700 |
---|---|---|
committer | Jo?o Duarte <jvsDuarte08@gmail.com> | 2019-07-26 08:58:56 -0700 |
commit | aa6a7d9238f2288a2fbca2e19f3ab855d0d43d95 (patch) | |
tree | bdc373803c16616da14efc25103c4cb534bf77c0 /util | |
parent | b29dab1c1c6185c310c6346910aa7e0c8ed72596 (diff) | |
download | prosody-aa6a7d9238f2288a2fbca2e19f3ab855d0d43d95.tar.gz prosody-aa6a7d9238f2288a2fbca2e19f3ab855d0d43d95.zip |
util.startup: .setup_plugindir now checks if the specified directory for custom plugins exists, and creates it if it doesn't
Diffstat (limited to 'util')
-rw-r--r-- | util/startup.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/util/startup.lua b/util/startup.lua index 363d8465..9ddb10b5 100644 --- a/util/startup.lua +++ b/util/startup.lua @@ -226,8 +226,8 @@ function startup.setup_datadir() end function startup.setup_plugindir() - --require "lfs".currentdir() - --local current_directory = lfs.currentdir() + --local lfs_currentdir = require "lfs".currentdir() + --local current_directory = lfs_currentdir 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); @@ -238,9 +238,9 @@ function startup.setup_plugindir() prosody.paths.plugins = CFG_PLUGINDIR; end -- Checking if the folder exists. If it doesn't, we create it - --[[if os.execute('[ -d "'..installer_plugin_path..'" ]') ~= 0 then + if os.execute('[ -d "'..installer_plugin_path..'" ]') ~= 0 then os.execute("mkdir "..installer_plugin_path) - end]] + end --[[if not string.find(package.path, current_directory..installer_plugin_path[path]) then --os.execute("ls -la "..current_directory..path_sep..installer_plugin_paths[path]) package.path = package.path..path_sep..current_directory..installer_plugin_path.."/?.lua"..path_sep..path_sep |