replace exec with system()

- closes #64
This commit is contained in:
gmarik 2011-11-23 01:12:50 -06:00
parent efa26be8f1
commit 73daf4eb9f

View File

@ -112,7 +112,7 @@ func! s:fetch_scripts(to)
let l:vim_scripts_json = 'http://vim-scripts.org/api/scripts.json'
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")
let temp = shellescape(tempname())
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 = '"'.cmd.'"' " enclose in quotes so && joined cmds work
end
silent exec '!'.cmd
else
echoerr 'Error curl or wget is not available!'
return 1
endif
call system(cmd)
if (0 != v:shell_error)
echoerr 'Error fetching scripts!'
return v:shell_error