Software / code / prosody
Comparison
util/pluginloader.lua @ 11131:40abef01f4b9
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
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Mon, 05 Oct 2020 20:58:37 +0200 |
| parent | 11130:10485a3ef78b |
| child | 12250:e157e5c79daa |
comparison
equal
deleted
inserted
replaced
| 11130:10485a3ef78b | 11131:40abef01f4b9 |
|---|---|
| 58 return f, path; | 58 return f, path; |
| 59 end | 59 end |
| 60 | 60 |
| 61 local function load_code_ext(plugin, resource, extension, env) | 61 local function load_code_ext(plugin, resource, extension, env) |
| 62 local content, err = load_resource(plugin, resource.."."..extension); | 62 local content, err = load_resource(plugin, resource.."."..extension); |
| 63 if not content and extension == "lib.lua" then | |
| 64 content, err = load_resource(plugin, resource..".lua"); | |
| 65 end | |
| 63 if not content then | 66 if not content then |
| 64 content, err = load_resource(resource, resource.."."..extension); | 67 content, err = load_resource(resource, resource.."."..extension); |
| 65 if not content then | 68 if not content then |
| 66 return content, err; | 69 return content, err; |
| 67 end | 70 end |