fix(spec): show error when users load a plugins module called `lazy`

This commit is contained in:
Folke Lemaitre 2023-01-03 22:49:04 +01:00
parent 953c2791d8
commit 1fd80159d0
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 3 additions and 0 deletions

View File

@ -158,6 +158,9 @@ end
---@param spec LazySpecImport
function Spec:import(spec)
if spec.import == "lazy" then
return self:error("You can't name your plugins module `lazy`.")
end
if spec.enabled == false or (type(spec.enabled) == "function" and not spec.enabled()) then
return
end