improve message
- add status to return values - check status to see if bundle installed
This commit is contained in:
parent
8009682591
commit
b75036a8e3
@ -70,7 +70,7 @@ endf
|
|||||||
func! s:sync(bang, bundle) abort
|
func! s:sync(bang, bundle) abort
|
||||||
let git_dir = expand(a:bundle.path().'/.git/')
|
let git_dir = expand(a:bundle.path().'/.git/')
|
||||||
if isdirectory(git_dir)
|
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'
|
let cmd = 'cd '.shellescape(a:bundle.path()).' && git pull'
|
||||||
|
|
||||||
if (has('win32') || has('win64'))
|
if (has('win32') || has('win64'))
|
||||||
@ -85,17 +85,18 @@ func! s:sync(bang, bundle) abort
|
|||||||
|
|
||||||
if 0 != v:shell_error
|
if 0 != v:shell_error
|
||||||
echohl Error | echo 'Error installing "'.a:bundle.name.'". Failed cmd: '.cmd | echohl None
|
echohl Error | echo 'Error installing "'.a:bundle.name.'". Failed cmd: '.cmd | echohl None
|
||||||
return v:shell_error
|
return [v:shell_error, 'error']
|
||||||
end
|
end
|
||||||
return 0
|
return [0, 'ok']
|
||||||
endf
|
endf
|
||||||
|
|
||||||
func! s:install(bang, bundles) abort
|
func! s:install(bang, bundles) abort
|
||||||
let [installed, errors] = [[],[]]
|
let [installed, errors] = [[],[]]
|
||||||
|
|
||||||
for b in a:bundles
|
for b in a:bundles
|
||||||
if 0 == s:sync(a:bang, b)
|
let err_code, status = s:sync(a:bang, b)
|
||||||
if a:bang | call add(installed, b) | endif
|
if 0 == err_code
|
||||||
|
if 'ok' == status | call add(installed, b) | endif
|
||||||
else
|
else
|
||||||
call add(errors, b)
|
call add(errors, b)
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user