Skip to content

Commit

Permalink
feat: add healthcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
lewis6991 committed Nov 7, 2022
1 parent fa1e8c5 commit 354d4de
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lua/gitsigns/health.lua

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions teal/gitsigns/health.tl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
local M = {}

function M.check()
local fns = vim.fn as {string:function}
local report_ok = fns['health#report_ok']
local report_error = fns['health#report_error']

local ok, v = pcall(vim.fn.systemlist, {'git', '--version'})

if not ok then
report_error(v)
else
report_ok(v[1])
end
end

return M
2 changes: 2 additions & 0 deletions types/types.d.tl
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,12 @@ global record vim
strdisplaywidth: function(string, integer): integer
stridx: function(haystack: string, needle: string, start: integer): integer
string: function(any): string
systemlist: function({string}): {string}
tempname: function(): string
type: function(any): integer
end

call: function(string, ...:any)
cmd: function(string): any

deepcopy: function<T>(T): T
Expand Down

0 comments on commit 354d4de

Please sign in to comment.