From adee0521bff6fd126163312e3693320f7aa29259 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 24 Jan 2023 08:17:10 +0100 Subject: [PATCH] feat(health): added some simple health checks --- lua/lazyvim/health.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 lua/lazyvim/health.lua diff --git a/lua/lazyvim/health.lua b/lua/lazyvim/health.lua new file mode 100644 index 00000000..7ea8fef7 --- /dev/null +++ b/lua/lazyvim/health.lua @@ -0,0 +1,21 @@ +local M = {} + +function M.check() + vim.health.report_start("LazyVim") + + if vim.fn.has("nvim-0.8.0") == 1 then + vim.health.report_ok("Using Neovim >= 0.8.0") + else + 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)) + else + vim.health.report_warn(("`%s` is not installed"):format(cmd)) + end + end +end + +return M