From da9efda74c9129e3dfff29fe15c86accbd6e460b Mon Sep 17 00:00:00 2001 From: gmarik Date: Sat, 23 Jul 2011 13:20:54 -0500 Subject: [PATCH] preserve cached scripts on errorneous response - wget only - curl preserves content with --fail switch --- autoload/vundle/scripts.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/autoload/vundle/scripts.vim b/autoload/vundle/scripts.vim index 7245597..a9a7fa4 100644 --- a/autoload/vundle/scripts.vim +++ b/autoload/vundle/scripts.vim @@ -70,7 +70,9 @@ func! s:fetch_scripts(to) if executable("curl") silent exec '!curl --fail -s -o '.shellescape(a:to).' '.l:vim_scripts_json elseif executable("wget") - silent exec '!wget -q -O '.shellescape(a:to).' '.l:vim_scripts_json + let temp = shellescape(tempname()) + let switch = (has('win32') || has('win64')) ? ' /Y ' : ' -f ' + silent exec '!wget -q -O '.temp.' '.l:vim_scripts_json. ' && mv '.switch.' '.temp.' '.shellescape(a:to) else echoerr 'Error curl or wget is not available!' return 1