From c1bbbaf3ef57a2a98f3cc1c0ea93357a4abd6de6 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Mon, 11 Aug 2014 01:42:14 +0900 Subject: [PATCH] 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 --- plug.vim | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/plug.vim b/plug.vim index e94d7f3..07b501f 100644 --- a/plug.vim +++ b/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.') 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. @@ -107,7 +103,10 @@ function! plug#begin(...) endfunction function! s:define_commands() - command! -nargs=+ -bar Plug call s:add() + command! -nargs=+ -bar Plug call s:add() + 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('' == '!', ) command! -nargs=* -bar -bang -complete=customlist,s:names PlugUpdate call s:update('' == '!', ) command! -nargs=0 -bar -bang PlugClean call s:clean('' == '!')