Changeset

12275:13624194984b

core.modulemanager: Save module metadata for potential later use Makes it reachable from the shell if nothing else
author Kim Alvefur <zash@zash.se>
date Sat, 05 Feb 2022 01:33:46 +0100
parents 12274:10447f940fec
children 12276:7c5e6ad3d778
files core/modulemanager.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/core/modulemanager.lua	Sat Feb 05 01:36:10 2022 +0100
+++ b/core/modulemanager.lua	Sat Feb 05 01:33:46 2022 +0100
@@ -219,7 +219,7 @@
 	local pluginenv = setmetatable({ module = api_instance }, { __index = _G });
 	api_instance.environment = pluginenv;
 
-	local mod, err = loader:load_code(module_name, nil, pluginenv);
+	local mod, err, meta = loader:load_code(module_name, nil, pluginenv);
 	if not mod then
 		log("error", "Unable to load module '%s': %s", module_name or "nil", err or "nil");
 		api_instance:set_status("error", "Failed to load (see log)");
@@ -227,6 +227,7 @@
 	end
 
 	api_instance.path = err;
+	api_instance.meta = meta;
 
 	local custom_plugins = prosody.paths.installer;
 	if custom_plugins and err:sub(1, #custom_plugins+1) == custom_plugins.."/" then