|
|
|
@ -4,14 +4,16 @@ func! vundle#installer#install(bang, ...) abort |
|
|
|
\ s:reload_bundles() : |
|
|
|
\ map(copy(a:000), 'vundle#config#init_bundle(v:val, {})') |
|
|
|
|
|
|
|
let installed = s:install(a:bang, bundles) |
|
|
|
redraw! |
|
|
|
let [installed, errors] = s:install(a:bang, bundles) |
|
|
|
if empty(errors) | redraw! | end |
|
|
|
" TODO: handle error: let user know hen they need to restart Vim |
|
|
|
call vundle#config#require(bundles) |
|
|
|
|
|
|
|
call s:log("Installed bundles:\n".join((empty(installed) ? |
|
|
|
\ ['no new bundles installed'] : |
|
|
|
\ map(installed, 'v:val.name')),"\n")) |
|
|
|
let msg = 'No new bundles were installed' |
|
|
|
if (!empty(installed)) |
|
|
|
let msg = "Installed bundles:\n".join(map(installed, 'v:val.name'),"\n") |
|
|
|
endif |
|
|
|
call s:log(msg) |
|
|
|
|
|
|
|
call vundle#installer#helptags(bundles) |
|
|
|
endf |
|
|
|
@ -21,7 +23,7 @@ func! vundle#installer#helptags(bundles) abort |
|
|
|
let help_dirs = filter(bundle_dirs, 's:has_doc(v:val)') |
|
|
|
call map(copy(help_dirs), 's:helptags(v:val)') |
|
|
|
if !empty(help_dirs) |
|
|
|
call s:log('Helptags: done. '.len(help_dirs).' bundles processed') |
|
|
|
call s:log('Helptags: '.len(help_dirs).' bundles processed') |
|
|
|
endif |
|
|
|
return help_dirs |
|
|
|
endf |
|
|
|
@ -68,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')) |
|
|
|
@ -78,12 +80,28 @@ func! s:sync(bang, bundle) abort |
|
|
|
else |
|
|
|
let cmd = 'git clone '.a:bundle.uri.' '.shellescape(a:bundle.path()) |
|
|
|
endif |
|
|
|
|
|
|
|
silent exec '!'.cmd |
|
|
|
return 1 |
|
|
|
|
|
|
|
if 0 != v:shell_error |
|
|
|
echohl Error | echo 'Error installing "'.a:bundle.name.'". Failed cmd: '.cmd | echohl None |
|
|
|
return [v:shell_error, 'error'] |
|
|
|
end |
|
|
|
return [0, 'ok'] |
|
|
|
endf |
|
|
|
|
|
|
|
func! s:install(bang, bundles) abort |
|
|
|
return filter(copy(a:bundles), 's:sync(a:bang, v:val)') |
|
|
|
let [installed, errors] = [[],[]] |
|
|
|
|
|
|
|
for b in a:bundles |
|
|
|
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 |
|
|
|
endfor |
|
|
|
return [installed, errors] |
|
|
|
endf |
|
|
|
|
|
|
|
" TODO: make it pause after output in console mode |
|
|
|
|