chore: update healthcheck for new API

This commit is contained in:
swaits committed 2024-09-03 14:19:45 -06:00
1 parent d452fe37f0
commit 2e6cbe6ab1
1 file changed
+9 -25
+9 -25
View File
@@ -1,32 +1,16 @@
local M = {}
M._check = function()
vim.health.start("zellij-nav.nvim")
local version = vim.fn.system("zellij --version")
if vim.v.shell_error ~= 0 then
vim.health.error("zellij executable not found in user's path")
else
vim.health.ok("found zellij version " .. string.gsub(version, "zellij ", ""))
end
end
M.deprecated_check = function()
vim.health.report_start("zellij-nav.nvim")
local version = vim.fn.system("zellij --version")
if vim.v.shell_error ~= 0 then
vim.health.report_error("zellij executable not found in user's path")
else
vim.health.report_ok("found zellij version " .. string.gsub(version, "zellij ", ""))
end
end
M.check = function()
local vim_version = vim.version()
if vim_version.minor > 10 then
M._check()
local start = vim.health.report_start or vim.health.start
local report_ok = vim.health.report_ok or vim.health.ok
local report_error = vim.health.report_error or vim.health.error
start("zellij-nav.nvim")
local version = vim.fn.system("zellij --version")
if vim.v.shell_error ~= 0 then
report_error("zellij executable not found in user's path")
else
M.deprecated_check()
report_ok("found zellij version " .. string.gsub(version, "zellij ", ""))
end
end