parent
efa26be8f1
commit
73daf4eb9f
@ -112,7 +112,7 @@ func! s:fetch_scripts(to)
|
|||||||
|
|
||||||
let l:vim_scripts_json = 'http://vim-scripts.org/api/scripts.json'
|
let l:vim_scripts_json = 'http://vim-scripts.org/api/scripts.json'
|
||||||
if executable("curl")
|
if executable("curl")
|
||||||
silent exec '!curl --fail -s -o '.shellescape(a:to).' '.l:vim_scripts_json
|
let cmd = 'curl --fail -s -o '.shellescape(a:to).' '.l:vim_scripts_json
|
||||||
elseif executable("wget")
|
elseif executable("wget")
|
||||||
let temp = shellescape(tempname())
|
let temp = shellescape(tempname())
|
||||||
let cmd = 'wget -q -O '.temp.' '.l:vim_scripts_json. ' && mv -f '.temp.' '.shellescape(a:to)
|
let cmd = 'wget -q -O '.temp.' '.l:vim_scripts_json. ' && mv -f '.temp.' '.shellescape(a:to)
|
||||||
@ -120,12 +120,13 @@ func! s:fetch_scripts(to)
|
|||||||
let cmd = substitute(cmd, 'mv -f ', 'mv /Y ') " change force flag
|
let cmd = substitute(cmd, 'mv -f ', 'mv /Y ') " change force flag
|
||||||
let cmd = '"'.cmd.'"' " enclose in quotes so && joined cmds work
|
let cmd = '"'.cmd.'"' " enclose in quotes so && joined cmds work
|
||||||
end
|
end
|
||||||
silent exec '!'.cmd
|
|
||||||
else
|
else
|
||||||
echoerr 'Error curl or wget is not available!'
|
echoerr 'Error curl or wget is not available!'
|
||||||
return 1
|
return 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
call system(cmd)
|
||||||
|
|
||||||
if (0 != v:shell_error)
|
if (0 != v:shell_error)
|
||||||
echoerr 'Error fetching scripts!'
|
echoerr 'Error fetching scripts!'
|
||||||
return v:shell_error
|
return v:shell_error
|
||||||
|
Loading…
Reference in New Issue
Block a user