From 47356d9ee5bdec47250d97dc1087846e3d2adbbd Mon Sep 17 00:00:00 2001 From: Kohei Takahashi Date: Tue, 19 Jul 2011 10:34:08 +0900 Subject: [PATCH] fallback to use wget --- autoload/vundle/scripts.vim | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/autoload/vundle/scripts.vim b/autoload/vundle/scripts.vim index 93a98ca..7245597 100644 --- a/autoload/vundle/scripts.vim +++ b/autoload/vundle/scripts.vim @@ -66,7 +66,15 @@ func! s:fetch_scripts(to) call mkdir(scripts_dir, "p") endif - silent exec '!curl --fail -s -o '.shellescape(a:to).' http://vim-scripts.org/api/scripts.json' + 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 + elseif executable("wget") + silent exec '!wget -q -O '.shellescape(a:to).' '.l:vim_scripts_json + else + echoerr 'Error curl or wget is not available!' + return 1 + endif if (0 != v:shell_error) echoerr 'Error fetching scripts!'