all repos

gopher.nvim @ 26b41bf68cc4882f07a0cc0505a4d3d9f42f0dbf

Minimalistic plugin for Go development

gopher.nvim/lua/gopher/_utils/health.lua(view raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
local h = vim.health or require "health"
local health = {}

health.start = h.start or h.report_start
health.ok = h.ok or h.report_ok
health.warn = h.warn or h.report_warn
health.error = h.error or h.report_error
health.info = h.info or h.report_info

---@param module string
---@return boolean
function health.is_lualib_found(module)
  local is_found, _ = pcall(require, module)
  return is_found
end

---@param bin string
---@return boolean
function health.is_binary_found(bin)
  if vim.fn.executable(bin) == 1 then
    return true
  end
  return false
end

return health