mirror of https://github.com/folke/lazy.nvim.git
fix(health): show what plugins need luarocks and if none, use warnings instead of errors. See #1551
This commit is contained in:
parent
9ac375653b
commit
0d9fd636be
|
@ -129,7 +129,26 @@ function M.check()
|
||||||
else
|
else
|
||||||
info("checking `luarocks` installation")
|
info("checking `luarocks` installation")
|
||||||
end
|
end
|
||||||
require("lazy.pkg.rockspec").check({ error = error, warn = warn, ok = ok })
|
local need_luarocks = {}
|
||||||
|
for _, plugin in pairs(spec.plugins) do
|
||||||
|
if plugin.build == "rockspec" then
|
||||||
|
table.insert(need_luarocks, plugin.name)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if #need_luarocks == 0 then
|
||||||
|
ok("no plugins require `luarocks`, so you can ignore any warnings below")
|
||||||
|
else
|
||||||
|
local lines = vim.tbl_map(function(name)
|
||||||
|
return " * `" .. name .. "`"
|
||||||
|
end, need_luarocks)
|
||||||
|
|
||||||
|
info("you have some plugins that require `luarocks`:\n" .. table.concat(lines, "\n"))
|
||||||
|
end
|
||||||
|
require("lazy.pkg.rockspec").check({
|
||||||
|
error = #need_luarocks > 0 and error or warn,
|
||||||
|
warn = warn,
|
||||||
|
ok = ok,
|
||||||
|
})
|
||||||
else
|
else
|
||||||
ok("luarocks disabled")
|
ok("luarocks disabled")
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue