Skip to content

Commit

Permalink
feat: add health check
Browse files Browse the repository at this point in the history
chore: show status for each formater
  • Loading branch information
jellydn committed Dec 1, 2023
1 parent 8ec207d commit 2a0d40b
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions lua/hurl/health.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
local M = {}

local start = vim.health.start or vim.health.report_start
local ok = vim.health.ok or vim.health.report_ok
local error = vim.health.error or vim.health.report_error

-- Add health check for default formatter: jq and prettier
function M.check()
start('hurl.nvim health check')
local jq = vim.fn.executable('jq')
local prettier = vim.fn.executable('prettier')

if jq == 0 then
error('jq not found')
else
ok('jq found')
end

if prettier == 0 then
error('prettier not found')
else
ok('prettier found')
end

ok('hurl.nvim: All good!')
end

return M

0 comments on commit 2a0d40b

Please sign in to comment.