feat(plugin): added support for virtual plugins. Closes #1836

This commit is contained in:
Folke Lemaitre 2024-12-06 20:28:50 +01:00
parent 3388a26417
commit ee64abc76b
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
5 changed files with 14 additions and 5 deletions

View file

@ -341,7 +341,9 @@ function M._load(plugin, reason, opts)
Util.track({ plugin = plugin.name, start = reason.start })
Handler.disable(plugin)
M.add_to_rtp(plugin)
if not plugin.virtual then
M.add_to_rtp(plugin)
end
if plugin._.pkg and plugin._.pkg.source == "rockspec" then
M.add_to_luapath(plugin)
@ -353,7 +355,9 @@ function M._load(plugin, reason, opts)
end, "Failed to load deps for " .. plugin.name)
end
M.packadd(plugin.dir)
if not plugin.virtual then
M.packadd(plugin.dir)
end
if plugin.config or plugin.opts then
M.config(plugin)
end