Diff

util/prosodyctl.lua @ 10167:f343ed1f02fd

util.prosodyctl: Created the helper function get_path_custom_plugins
author João Duarte <jvsDuarte08@gmail.com>
date Wed, 24 Jul 2019 11:20:35 -0700
parent 10158:2cb48153f9e0
child 10180:152604d54732
line wrap: on
line diff
--- a/util/prosodyctl.lua	Wed Jul 24 10:48:20 2019 -0700
+++ b/util/prosodyctl.lua	Wed Jul 24 11:20:35 2019 -0700
@@ -288,6 +288,14 @@
 	return true;
 end
 
+local function get_path_custom_plugins(plugin_paths)
+		-- I'm considering that we are using just one path to custom plugins, and it is the first in prosody.paths.plugins, for now
+	-- luacheck: ignore 512
+	for path in plugin_paths:gmatch("[^;]+") do
+		return path
+	end
+end
+
 return {
 	show_message = show_message;
 	show_warning = show_message;
@@ -308,4 +316,5 @@
 	start = start;
 	stop = stop;
 	reload = reload;
+	get_path_custom_plugins = get_path_custom_plugins;
 };