Comparison

loader.lua @ 12947:14a44b1a51d0

prosody.loader: Allow loading modules under 'prosody' namespace (#1223) Actually `hg mv`-ing all the files is disruptive, basically breaking everything from rebasing all my WIP draft commits to the package building. So instead, what if we didn't and instead rewrote package names as they are `require()`-d? Debian packages produced by the Prosody are already installed into this structure so much will Just Work if all require calls are updated.
author Kim Alvefur <zash@zash.se>
date Fri, 17 Mar 2023 13:51:43 +0100
child 12948:29983f09c913
comparison
equal deleted inserted replaced
12946:59478b295137 12947:14a44b1a51d0
1 for i = #package.searchers, 1, -1 do
2 local search = package.searchers[i];
3 table.insert(package.searchers, i, function(module_name)
4 local lib = module_name:match("^prosody%.(.*)$");
5 if lib then
6 return search(lib);
7 end
8 end)
9 end