From d198a193256429e401fbec7fa8ac7a46de06f07b Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 15 Feb 2023 14:03:41 +0100 Subject: [PATCH] fix(health): also check for fdfind instead of just fd. Fixes #270 --- lua/lazyvim/health.lua | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/lua/lazyvim/health.lua b/lua/lazyvim/health.lua index 7ea8fef7..aca7fa7e 100644 --- a/lua/lazyvim/health.lua +++ b/lua/lazyvim/health.lua @@ -9,11 +9,23 @@ function M.check() vim.health.report_error("Neovim >= 0.8.0 is required") end - for _, cmd in ipairs({ "git", "rg", "fd", "lazygit" }) do - if vim.fn.executable(cmd) == 1 then - vim.health.report_ok(("`%s` is installed"):format(cmd)) + for _, cmd in ipairs({ "git", "rg", { "fd", "fdfind" }, "lazygit" }) do + local name = type(cmd) == "string" and cmd or vim.inspect(cmd) + local commands = type(cmd) == "string" and { cmd } or cmd + ---@cast commands string[] + local found = false + + for _, c in ipairs(commands) do + if vim.fn.executable(c) == 1 then + name = c + found = true + end + end + + if found then + vim.health.report_ok(("`%s` is installed"):format(name)) else - vim.health.report_warn(("`%s` is not installed"):format(cmd)) + vim.health.report_warn(("`%s` is not installed"):format(name)) end end end