fix(plugin): rebuild plugins after fixing optional and cond to ensure enabled will work correctly

This commit is contained in:
Folke Lemaitre 2023-10-04 11:48:14 +02:00
parent 28a80136b5
commit 638c8e6382
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 5 additions and 0 deletions

View File

@ -292,7 +292,12 @@ function Spec:fix_disabled()
end
self:fix_optional()
-- rebuild any plugin specs that were modified
for name, _ in pairs(self.dirty) do
self:rebuild(name)
end
self:fix_cond()
self.dirty = {}
for _, plugin in pairs(self.plugins) do
local disabled = plugin.enabled == false or (type(plugin.enabled) == "function" and not plugin.enabled())