Skip to content

Commit 1c854d7

Browse files
committed
fix(health): check for all packages on the rtp, excluding dist packs
1 parent c85f929 commit 1c854d7

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

lua/lazy/health.lua

+14-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
1-
local Util = require("lazy.util")
21
local Config = require("lazy.core.config")
32

43
local M = {}
54

65
function M.check()
76
vim.health.report_start("lazy.nvim")
87

8+
local sites = vim.opt.packpath:get()
9+
local default_site = vim.fn.stdpath("data") .. "/site"
10+
if not vim.tbl_contains(sites, default_site) then
11+
sites[#sites + 1] = default_site
12+
end
13+
914
local existing = false
10-
Util.ls(vim.fn.stdpath("data") .. "/site/pack/", function(path)
11-
existing = true
12-
vim.health.report_warn("found existing packages at `" .. path .. "`")
13-
end)
15+
for _, site in pairs(sites) do
16+
for _, packs in ipairs(vim.fn.expand(site .. "/pack/*", false, true)) do
17+
if not packs:find("/dist$") and vim.loop.fs_stat(packs) then
18+
existing = true
19+
vim.health.report_warn("found existing packages at `" .. packs .. "`")
20+
end
21+
end
22+
end
1423
if not existing then
1524
vim.health.report_ok("no existing packages found by other package managers")
1625
end

0 commit comments

Comments
 (0)