Created
July 18, 2011 13:22
-
-
Save Shougo/1089495 to your computer and use it in GitHub Desktop.
This file contains 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:BundleGet() "{{{ | |
let bundle_dir = expand('~/.vim/bundle') | |
try | |
let org_cwd = getcwd() | |
silent lcd `=bundle_dir` | |
let repo = matchstr(getline('.'), 'BUNDLE:\s\+\zs.*') | |
if repo != '' | |
let local_name = substitute(fnamemodify(repo, ':t'), | |
\ '^\%\(vim-\)\?\(.*\).git','\1', '') | |
if isdirectory(local_name) | |
let cmd = 'cd ' . local_name | |
echo cmd | |
lcd `=local_name` | |
let cmd = 'git pull' | |
echo cmd | |
let output = vimproc#system(cmd) | |
echo output | |
else | |
let cmd = 'git clone ' . repo . ' ' . local_name | |
echo cmd | |
let output = vimproc#system(cmd) | |
echo output | |
endif | |
endif | |
finally | |
silent lcd `=org_cwd` | |
endtry | |
endfunction"}}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment