Skip to content

Commit 1d1c2b0

Browse files
committed
Merge pull request #684 from cameris/master
Added variables for git, curl & wget executables
2 parents a6575b6 + ff02eb1 commit 1d1c2b0

File tree

3 files changed

+26
-14
lines changed

3 files changed

+26
-14
lines changed

autoload/vundle.vim

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,14 @@ let vundle#lazy_load = 0
8787
let vundle#log = []
8888
let vundle#updated_bundles = []
8989

90+
if !exists('g:vundle#git_executable')
91+
let vundle#git_executable = 'git'
92+
endif
93+
if !exists('g:vundle#curl_executable')
94+
let vundle#curl_executable = 'curl'
95+
endif
96+
if !exists('g:vundle#wget_executable')
97+
let vundle#wget_executable = 'wget'
98+
endif
99+
90100
" vim: set expandtab sts=2 ts=2 sw=2 tw=78 norl:

autoload/vundle/installer.vim

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,8 @@ endf
343343
" return -- the URL for the origin remote (string)
344344
" ---------------------------------------------------------------------------
345345
func! s:get_current_origin_url(bundle) abort
346-
let cmd = 'cd '.vundle#installer#shellesc(a:bundle.path()).' && git config --get remote.origin.url'
346+
let cmd = 'cd '.vundle#installer#shellesc(a:bundle.path()).' && '.
347+
g:vundle#git_executable.' config --get remote.origin.url'
347348
let cmd = vundle#installer#shellesc_cd(cmd)
348349
let out = s:strip(s:system(cmd))
349350
return out
@@ -357,7 +358,8 @@ endf
357358
" return -- A 15 character log sha for the current HEAD
358359
" ---------------------------------------------------------------------------
359360
func! s:get_current_sha(bundle)
360-
let cmd = 'cd '.vundle#installer#shellesc(a:bundle.path()).' && git rev-parse HEAD'
361+
let cmd = 'cd '.vundle#installer#shellesc(a:bundle.path()).' && '.
362+
g:vundle#git_executable.' rev-parse HEAD'
361363
let cmd = vundle#installer#shellesc_cd(cmd)
362364
let out = s:system(cmd)[0:15]
363365
return out
@@ -389,10 +391,10 @@ func! s:make_sync_command(bang, bundle) abort
389391
" Directory names match but the origin remotes are not the same
390392
let cmd_parts = [
391393
\ 'cd '.vundle#installer#shellesc(a:bundle.path()) ,
392-
\ 'git remote set-url origin ' . vundle#installer#shellesc(a:bundle.uri),
393-
\ 'git fetch',
394-
\ 'git reset --hard origin/HEAD',
395-
\ 'git submodule update --init --recursive',
394+
\ g:vundle#git_executable.' remote set-url origin ' . vundle#installer#shellesc(a:bundle.uri),
395+
\ g:vundle#git_executable.' fetch',
396+
\ g:vundle#git_executable.' reset --hard origin/HEAD',
397+
\ g:vundle#git_executable.' submodule update --init --recursive',
396398
\ ]
397399
let cmd = join(cmd_parts, ' && ')
398400
let cmd = vundle#installer#shellesc_cd(cmd)
@@ -407,15 +409,15 @@ func! s:make_sync_command(bang, bundle) abort
407409

408410
let cmd_parts = [
409411
\ 'cd '.vundle#installer#shellesc(a:bundle.path()),
410-
\ 'git pull',
411-
\ 'git submodule update --init --recursive',
412+
\ g:vundle#git_executable.' pull',
413+
\ g:vundle#git_executable.' submodule update --init --recursive',
412414
\ ]
413415
let cmd = join(cmd_parts, ' && ')
414416
let cmd = vundle#installer#shellesc_cd(cmd)
415417

416418
let initial_sha = s:get_current_sha(a:bundle)
417419
else
418-
let cmd = 'git clone --recursive '.vundle#installer#shellesc(a:bundle.uri).' '.vundle#installer#shellesc(a:bundle.path())
420+
let cmd = g:vundle#git_executable.' clone --recursive '.vundle#installer#shellesc(a:bundle.uri).' '.vundle#installer#shellesc(a:bundle.path())
419421
let initial_sha = ''
420422
endif
421423
return [cmd, initial_sha]

autoload/vundle/scripts.vim

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func! s:create_changelog() abort
8585
let bundle = bundle_data[2]
8686

8787
let cmd = 'cd '.vundle#installer#shellesc(bundle.path()).
88-
\ ' && git log --pretty=format:"%s %an, %ar" --graph '.
88+
\ ' && '.g:vundle#git_executable.' log --pretty=format:"%s %an, %ar" --graph '.
8989
\ initial_sha.'..'.updated_sha
9090

9191
let cmd = vundle#installer#shellesc_cd(cmd)
@@ -236,11 +236,11 @@ func! s:fetch_scripts(to)
236236
endif
237237

238238
let l:vim_scripts_json = 'http://vim-scripts.org/api/scripts.json'
239-
if executable("curl")
240-
let cmd = 'curl --fail -s -o '.vundle#installer#shellesc(a:to).' '.l:vim_scripts_json
241-
elseif executable("wget")
239+
if executable(g:vundle#curl_executable)
240+
let cmd = g:vundle#curl_executable.' --fail -s -o '.vundle#installer#shellesc(a:to).' '.l:vim_scripts_json
241+
elseif executable(g:vundle#wget_executable)
242242
let temp = vundle#installer#shellesc(tempname())
243-
let cmd = 'wget -q -O '.temp.' '.l:vim_scripts_json. ' && mv -f '.temp.' '.vundle#installer#shellesc(a:to)
243+
let cmd = g:vundle#wget_executable.' -q -O '.temp.' '.l:vim_scripts_json. ' && mv -f '.temp.' '.vundle#installer#shellesc(a:to)
244244
if (has('win32') || has('win64'))
245245
let cmd = substitute(cmd, 'mv -f ', 'move /Y ', '') " change force flag
246246
let cmd = vundle#installer#shellesc(cmd)

0 commit comments

Comments
 (0)