(chore): updated health.lua to use the new 0.11 api. (#2)
This commit is contained in:
1 parent
2593080439
commit
d452fe37f0
1 file changed
+27
-7
@@ -1,13 +1,33 @@
|
|||||||
local M = {}
|
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()
|
M.check = function()
|
||||||
vim.health.report_start("zellij-nav.nvim")
|
local vim_version = vim.version()
|
||||||
local version = vim.fn.system("zellij --version")
|
if vim_version.minor > 10 then
|
||||||
if vim.v.shell_error ~= 0 then
|
M._check()
|
||||||
vim.health.report_error("zellij executable not found in user's path")
|
else
|
||||||
else
|
M.deprecated_check()
|
||||||
vim.health.report_ok("found zellij version " .. string.gsub(version, "zellij ", ""))
|
end
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
Reference in new issue
Block a user