aboutsummaryrefslogtreecommitdiffstats
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
commit093110478e9ad8bbc539a10b07ce968387255a74 (patch)
treebdc373803c16616da14efc25103c4cb534bf77c0
parent63071336691c272dded2c1b7d74e58d78a6ae8ca (diff)
downloadprosody-093110478e9ad8bbc539a10b07ce968387255a74.tar.gz
prosody-093110478e9ad8bbc539a10b07ce968387255a74.zip
util.startup: .setup_plugindir now checks if the specified directory for custom plugins exists, and creates it if it doesn't
-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