diff --git a/lua/gitsigns/health.lua b/lua/gitsigns/health.lua new file mode 100644 index 000000000..b42dda694 --- /dev/null +++ b/lua/gitsigns/health.lua @@ -0,0 +1,17 @@ +local M = {} + +function M.check() + local fns = vim.fn + 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 diff --git a/teal/gitsigns/health.tl b/teal/gitsigns/health.tl new file mode 100644 index 000000000..90f194695 --- /dev/null +++ b/teal/gitsigns/health.tl @@ -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 diff --git a/types/types.d.tl b/types/types.d.tl index 03649d5ad..61253a1fb 100644 --- a/types/types.d.tl +++ b/types/types.d.tl @@ -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