util.pluginloader: Look for module libs in mod_plugin/lib.lua
authorKim Alvefur <zash@zash.se>
Mon, 05 Oct 2020 20:58:37 +0200
changeset 11135 40abef01f4b9
parent 11134 10485a3ef78b
child 11136 287d0d80aa57
util.pluginloader: Look for module libs in mod_plugin/lib.lua Luarocks can't be told to install something as foo.lib.lua AFAIK, so instead let's try mod_bar/foo.lua
util/pluginloader.lua
--- a/util/pluginloader.lua	Mon Oct 05 20:56:53 2020 +0200
+++ b/util/pluginloader.lua	Mon Oct 05 20:58:37 2020 +0200
@@ -60,6 +60,9 @@
 
 local function load_code_ext(plugin, resource, extension, env)
 	local content, err = load_resource(plugin, resource.."."..extension);
+	if not content and extension == "lib.lua" then
+		content, err = load_resource(plugin, resource..".lua");
+	end
 	if not content then
 		content, err = load_resource(resource, resource.."."..extension);
 		if not content then