Changeset

10174:55dc8eb1e7d3

util.startup: .setup_plugindir now checks if the specified directory for custom plugins exists, and creates it if it doesn't
author João Duarte <jvsDuarte08@gmail.com>
date Fri, 26 Jul 2019 08:58:56 -0700
parents 10173:0513dd2830b7
children 10175:4dac771ddf9f
files util/startup.lua
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/util/startup.lua	Fri Jul 26 08:39:27 2019 -0700
+++ b/util/startup.lua	Fri Jul 26 08:58:56 2019 -0700
@@ -226,8 +226,8 @@
 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 @@
 		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