aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorJo?o Duarte <jvsDuarte08@gmail.com>2019-07-26 08:58:56 -0700
committerJo?o Duarte <jvsDuarte08@gmail.com>2019-07-26 08:58:56 -0700
commitaa6a7d9238f2288a2fbca2e19f3ab855d0d43d95 (patch)
treebdc373803c16616da14efc25103c4cb534bf77c0 /util
parentb29dab1c1c6185c310c6346910aa7e0c8ed72596 (diff)
downloadprosody-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.lua8
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