From aa6a7d9238f2288a2fbca2e19f3ab855d0d43d95 Mon Sep 17 00:00:00 2001 From: Jo?o Duarte Date: Fri, 26 Jul 2019 08:58:56 -0700 Subject: util.startup: .setup_plugindir now checks if the specified directory for custom plugins exists, and creates it if it doesn't --- util/startup.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'util') 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 -- cgit v1.2.3