Browse Source

preserve cached scripts on errorneous response

- wget only
- curl preserves content with --fail switch
pull/71/head
gmarik 15 years ago
parent
commit
da9efda74c
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      autoload/vundle/scripts.vim

+ 3
- 1
autoload/vundle/scripts.vim View File

@ -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


Loading…
Cancel
Save