From b75036a8e3514b7b0f9859ea8b95ee4d5651dbae Mon Sep 17 00:00:00 2001 From: gmarik Date: Fri, 15 Jul 2011 01:56:46 -0500 Subject: [PATCH] improve message - add status to return values - check status to see if bundle installed --- autoload/vundle/installer.vim | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/autoload/vundle/installer.vim b/autoload/vundle/installer.vim index 4fdb225..bcd735e 100644 --- a/autoload/vundle/installer.vim +++ b/autoload/vundle/installer.vim @@ -70,7 +70,7 @@ endf func! s:sync(bang, bundle) abort let git_dir = expand(a:bundle.path().'/.git/') if isdirectory(git_dir) - if !(a:bang) | return 0 | endif + if !(a:bang) | return [0, 'skip'] | endif let cmd = 'cd '.shellescape(a:bundle.path()).' && git pull' if (has('win32') || has('win64')) @@ -85,17 +85,18 @@ func! s:sync(bang, bundle) abort if 0 != v:shell_error echohl Error | echo 'Error installing "'.a:bundle.name.'". Failed cmd: '.cmd | echohl None - return v:shell_error + return [v:shell_error, 'error'] end - return 0 + return [0, 'ok'] endf func! s:install(bang, bundles) abort let [installed, errors] = [[],[]] for b in a:bundles - if 0 == s:sync(a:bang, b) - if a:bang | call add(installed, b) | endif + let err_code, status = s:sync(a:bang, b) + if 0 == err_code + if 'ok' == status | call add(installed, b) | endif else call add(errors, b) endif