Changeset

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
parents 10166:4d1206ac0d41
children 10168:f365f814d641
files util/prosodyctl.lua
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
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;
 };