preserve cached scripts on errorneous response
- wget only - curl preserves content with --fail switch
This commit is contained in:
parent
a9609d88c4
commit
da9efda74c
@ -70,7 +70,9 @@ func! s:fetch_scripts(to)
|
|||||||
if executable("curl")
|
if executable("curl")
|
||||||
silent exec '!curl --fail -s -o '.shellescape(a:to).' '.l:vim_scripts_json
|
silent exec '!curl --fail -s -o '.shellescape(a:to).' '.l:vim_scripts_json
|
||||||
elseif executable("wget")
|
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
|
else
|
||||||
echoerr 'Error curl or wget is not available!'
|
echoerr 'Error curl or wget is not available!'
|
||||||
return 1
|
return 1
|
||||||
|
Loading…
Reference in New Issue
Block a user