diff options
Diffstat (limited to 'runtime/autoload/health/provider.vim')
-rw-r--r-- | runtime/autoload/health/provider.vim | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/runtime/autoload/health/provider.vim b/runtime/autoload/health/provider.vim index cb32dab376..9cf540ba09 100644 --- a/runtime/autoload/health/provider.vim +++ b/runtime/autoload/health/provider.vim @@ -36,12 +36,15 @@ endfunction " Run a system command and timeout after 30 seconds. function! s:system(cmd, ...) abort let stdin = a:0 ? a:1 : '' + let ignore_stderr = a:0 > 1 ? a:2 : 0 let opts = { \ 'output': '', \ 'on_stdout': function('s:system_handler'), - \ 'on_stderr': function('s:system_handler'), \ 'on_exit': function('s:system_handler'), \ } + if !ignore_stderr + let opts.on_stderr = function('s:system_handler') + endif let jobid = jobstart(a:cmd, opts) if jobid < 1 @@ -258,8 +261,7 @@ function! s:check_python(version) abort call health#report_ok(printf('pyenv found: "%s"', pyenv)) endif - let python_bin = s:trim(s:system( - \ printf('"%s" which %s 2>/dev/null', pyenv, python_bin_name))) + let python_bin = s:trim(s:system([pyenv, 'which', python_bin_name], '', 1)) if empty(python_bin) call health#report_warn(printf('pyenv couldn''t find %s.', python_bin_name)) @@ -416,9 +418,8 @@ function! s:check_ruby() abort let prog_vers = 'not found' call health#report_error('Missing Neovim RubyGem', suggestions) else - silent let latest_gem = get(s:systemlist("gem list -ra '^neovim$' 2>/dev/null | " . - \ "awk -F'[()]' '{print $2}' | " . - \ 'cut -d, -f1'), 0, 'not found') + silent let latest_gem = get(split(s:system(['gem', 'list', '-ra', '^neovim$']), + \ ' (\|, \|)$' ), 1, 'not found') let latest_desc = ' (latest: ' . latest_gem . ')' silent let prog_vers = s:systemlist(ruby_prog . ' --version')[0] |