Skip to content

Instantly share code, notes, and snippets.

@mattn
Created October 25, 2011 01:44
Show Gist options
  • Save mattn/1311071 to your computer and use it in GitHub Desktop.
Save mattn/1311071 to your computer and use it in GitHub Desktop.
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