|
|
|
@ -210,12 +210,10 @@ func! s:sync(bang, bundle) abort |
|
|
|
if !(a:bang) | return 'todate' | endif |
|
|
|
let cmd = 'cd '.shellescape(a:bundle.path()).' && git pull && git submodule update --init --recursive' |
|
|
|
|
|
|
|
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 |
|
|
|
let cmd = g:shellesc_cd(cmd) |
|
|
|
|
|
|
|
let get_current_sha = 'cd '.shellescape(a:bundle.path()).' && git rev-parse HEAD' |
|
|
|
let get_current_sha = g:shellesc_cd(get_current_sha) |
|
|
|
let initial_sha = s:system(get_current_sha)[0:15] |
|
|
|
else |
|
|
|
let cmd = 'git clone --recursive '.a:bundle.uri.' '.shellescape(a:bundle.path()) |
|
|
|
@ -246,6 +244,25 @@ func! s:sync(bang, bundle) abort |
|
|
|
return 'updated' |
|
|
|
endf |
|
|
|
|
|
|
|
func! g:shellesc(cmd) abort |
|
|
|
if (has('win32') || has('win64')) |
|
|
|
if &shellxquote != '(' " workaround for patch #445 |
|
|
|
return '"'.a:cmd.'"' " enclose in quotes so && joined cmds work |
|
|
|
endif |
|
|
|
endif |
|
|
|
return a:cmd |
|
|
|
endf |
|
|
|
|
|
|
|
func! g:shellesc_cd(cmd) abort |
|
|
|
if (has('win32') || has('win64')) |
|
|
|
let cmd = substitute(a:cmd, '^cd ','cd /d ','') " add /d switch to change drives |
|
|
|
let cmd = g:shellesc(cmd) |
|
|
|
return cmd |
|
|
|
else |
|
|
|
return a:cmd |
|
|
|
endif |
|
|
|
endf |
|
|
|
|
|
|
|
func! s:system(cmd) abort |
|
|
|
return system(a:cmd) |
|
|
|
endf |
|
|
|
|