Merge #8335 from blueyed/provider

This commit is contained in:
Justin M. Keyes 2018-05-01 08:41:43 +02:00 committed by GitHub
commit 5d6732ff09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 5 deletions

View File

@ -51,7 +51,7 @@ function! s:shellify(cmd) abort
return a:cmd
endif
return join(map(copy(a:cmd),
\'v:val =~# ''\m[\-.a-zA-Z_/]'' ? shellescape(v:val) : v:val'), ' ')
\'v:val =~# ''\m[^\-.a-zA-Z_/]'' ? shellescape(v:val) : v:val'), ' ')
endfunction
" Run a system command and timeout after 30 seconds.
@ -70,7 +70,8 @@ function! s:system(cmd, ...) abort
let jobid = jobstart(a:cmd, opts)
if jobid < 1
call health#report_error(printf('Command error (job=%d): %s', jobid, s:shellify(a:cmd)))
call health#report_error(printf('Command error (job=%d): `%s` (in %s)',
\ jobid, s:shellify(a:cmd), string(getcwd())))
let s:shell_error = 1
return opts.output
endif
@ -84,8 +85,8 @@ function! s:system(cmd, ...) abort
call health#report_error(printf('Command timed out: %s', s:shellify(a:cmd)))
call jobstop(jobid)
elseif s:shell_error != 0 && !ignore_error
call health#report_error(printf("Command error (job=%d): %s\nOutput: %s", jobid,
\ s:shellify(a:cmd), opts.output))
call health#report_error(printf("Command error (job=%d): `%s` (in %s)\nOutput: %s",
\ jobid, s:shellify(a:cmd), string(getcwd()), opts.output))
endif
return opts.output
@ -185,7 +186,9 @@ function! s:version_info(python) abort
endif
let nvim_path = s:trim(s:system([
\ a:python, '-c', 'import neovim; print(neovim.__file__)']))
\ a:python, '-c',
\ 'import sys; sys.path.remove(""); ' .
\ 'import neovim; print(neovim.__file__)']))
if s:shell_error || empty(nvim_path)
return [python_version, 'unable to load neovim Python module', pypi_version,
\ nvim_path]