Created
October 25, 2011 01:44
-
-
Save mattn/1311071 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! s:BundleUpdate() | |
silent new __BUNDLE_UPDATE__ | |
setlocal buftype=nofile | |
redraw | |
for rtp in pathogen#split(&rtp) | |
let path = expand(rtp, ':p') | |
if isdirectory(printf("%s/.git", path)) | |
if &shellslash | |
let command = printf('cd ''%s'' && git pull', path) | |
else | |
let command = printf('cmd /c "cd %s & git pull"', path) | |
endif | |
call setline(line('$'), [printf("updating %s", strpart(path, strridx(path, pathogen#separator())+1)), ""]) | |
redraw | |
call setline(line('$'), map(split(system(command), "\n"), '" ".v:val')) | |
redraw | |
normal! G | |
endif | |
endfor | |
endfunction | |
command! BundleUpdate :call <SID>BundleUpdate() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment