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:
Junegunn Choi 2014-08-11 01:42:14 +09:00
parent f7ebba7b9e
commit c1bbbaf3ef

View file

@ -93,10 +93,6 @@ function! plug#begin(...)
return s:err('Unable to determine plug home. Try calling plug#begin() with a path argument.')
endif
if !executable('git')
return s:err('`git` executable not found. vim-plug requires git.')
endif
let g:plug_home = home
let g:plugs = {}
" we want to keep track of the order plugins where registered.
@ -108,6 +104,9 @@ endfunction
function! s:define_commands()
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 PlugUpdate call s:update('<bang>' == '!', <f-args>)
command! -nargs=0 -bar -bang PlugClean call s:clean('<bang>' == '!')