perf(rocks): vim.fn.executable is slow on WSL2, so only check for luarocks when needed. Closes #1585

This commit is contained in:
Folke Lemaitre 2024-06-29 11:44:31 +02:00
parent 8dd947fccd
commit 9ab3061690
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
4 changed files with 21 additions and 11 deletions

View file

@ -336,16 +336,16 @@ function M.load()
end
-- add hererocks when enabled and needed
if Config.options.rocks.hererocks then
for _, plugin in pairs(Config.spec.plugins) do
if plugin.build == "rockspec" then
for _, plugin in pairs(Config.spec.plugins) do
if plugin.build == "rockspec" then
if Config.hererocks() then
Config.spec.meta:add({
"luarocks/hererocks",
build = "rockspec",
lazy = true,
})
break
end
break
end
end