Allow Plug command even when git executable is not found (#52)
- plug#begin() will return 1 even when git executable is not found - Commands that require git will not be available - If you wish to ignore the error message prepend `silent!` to the call
This commit is contained in:
parent
f7ebba7b9e
commit
c1bbbaf3ef
7
plug.vim
7
plug.vim
|
@ -93,10 +93,6 @@ function! plug#begin(...)
|
||||||
return s:err('Unable to determine plug home. Try calling plug#begin() with a path argument.')
|
return s:err('Unable to determine plug home. Try calling plug#begin() with a path argument.')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !executable('git')
|
|
||||||
return s:err('`git` executable not found. vim-plug requires git.')
|
|
||||||
endif
|
|
||||||
|
|
||||||
let g:plug_home = home
|
let g:plug_home = home
|
||||||
let g:plugs = {}
|
let g:plugs = {}
|
||||||
" we want to keep track of the order plugins where registered.
|
" we want to keep track of the order plugins where registered.
|
||||||
|
@ -108,6 +104,9 @@ endfunction
|
||||||
|
|
||||||
function! s:define_commands()
|
function! s:define_commands()
|
||||||
command! -nargs=+ -bar Plug call s:add(<args>)
|
command! -nargs=+ -bar Plug call s:add(<args>)
|
||||||
|
if !executable('git')
|
||||||
|
return s:err('`git` executable not found. vim-plug requires git.')
|
||||||
|
endif
|
||||||
command! -nargs=* -bar -bang -complete=customlist,s:names PlugInstall call s:install('<bang>' == '!', <f-args>)
|
command! -nargs=* -bar -bang -complete=customlist,s:names PlugInstall call s:install('<bang>' == '!', <f-args>)
|
||||||
command! -nargs=* -bar -bang -complete=customlist,s:names PlugUpdate call s:update('<bang>' == '!', <f-args>)
|
command! -nargs=* -bar -bang -complete=customlist,s:names PlugUpdate call s:update('<bang>' == '!', <f-args>)
|
||||||
command! -nargs=0 -bar -bang PlugClean call s:clean('<bang>' == '!')
|
command! -nargs=0 -bar -bang PlugClean call s:clean('<bang>' == '!')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user