Skip to content

Instantly share code, notes, and snippets.

@pocket7878
Created July 15, 2011 04:44
Show Gist options
  • Save pocket7878/1084085 to your computer and use it in GitHub Desktop.
Save pocket7878/1084085 to your computer and use it in GitHub Desktop.
little change for syncj
func! s:sync(bang, bundle) abort
let git_dir = expand(a:bundle.path().'/.git/')
if isdirectory(git_dir)
if !(a:bang) | return 0 | endif
let cmd = 'git pull'
if (has('win32') || has('win64'))
"let cmd = substitute(cmd, '^cd ','cd /d ','') " add /d switch to change drives
let cmd = '"'.cmd.'"' " enclose in quotes
endif
"cd to bundle path"
cd `=a:bundle.path()`
let l:result = s:system(cmd)
if l:result =~ "^Already up-to-date."
return 0
else
return 1
endif
else
let cmd = 'git clone '.a:bundle.uri.' '.a:bundle.path()
call s:system(cmd)
return 1
endif
endf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment