Browse Source

Merge 1fabba0379 into 555b5195d7

pull/55/merge
GitHub Merge Button 15 years ago
parent
commit
ba9243c512
2 changed files with 10 additions and 5 deletions
  1. +6
    -1
      autoload/vundle/config.vim
  2. +4
    -4
      autoload/vundle/installer.vim

+ 6
- 1
autoload/vundle/config.vim View File

@ -40,6 +40,7 @@ endf
func! s:parse_name(arg) func! s:parse_name(arg)
let arg = a:arg let arg = a:arg
let vcs = 'git'
if arg =~? '^\s*\(gh\|github\):\S\+' if arg =~? '^\s*\(gh\|github\):\S\+'
\ || arg =~? '^[a-z0-9][a-z0-9-]*/[^/]\+$' \ || arg =~? '^[a-z0-9][a-z0-9-]*/[^/]\+$'
let uri = 'https://github.com/'.split(arg, ':')[-1] let uri = 'https://github.com/'.split(arg, ':')[-1]
@ -49,11 +50,15 @@ func! s:parse_name(arg)
\ || arg =~? '\.git\s*$' \ || arg =~? '\.git\s*$'
let uri = arg let uri = arg
let name = split( substitute(uri,'/\?\.git\s*$','','i') ,'\/')[-1] let name = split( substitute(uri,'/\?\.git\s*$','','i') ,'\/')[-1]
elseif arg =~? '^lp:'
let uri = arg
let name = split (uri, ':')[-1]
let vcs = 'bzr'
else else
let name = arg let name = arg
let uri = 'https://github.com/vim-scripts/'.name.'.git' let uri = 'https://github.com/vim-scripts/'.name.'.git'
endif endif
return {'name': name, 'uri': uri }
return {'name': name, 'uri': uri, 'vcs': vcs }
endf endf
func! s:rtp_rm_a() func! s:rtp_rm_a()


+ 4
- 4
autoload/vundle/installer.vim View File

@ -66,17 +66,17 @@ func! s:helptags(rtp) abort
endf endf
func! s:sync(bang, bundle) abort func! s:sync(bang, bundle) abort
let git_dir = expand(a:bundle.path().'/.git/')
if isdirectory(git_dir)
let repo_dir = expand(a:bundle.path().'/.'.a:bundle.vcs.'/')
if isdirectory(repo_dir)
if !(a:bang) | return 0 | endif if !(a:bang) | return 0 | endif
let cmd = 'cd '.shellescape(a:bundle.path()).' && git pull'
let cmd = 'cd '.shellescape(a:bundle.path()).' && '.a:bundle.vcs.' pull'
if (has('win32') || has('win64')) if (has('win32') || has('win64'))
let cmd = substitute(cmd, '^cd ','cd /d ','') " add /d switch to change drives let cmd = substitute(cmd, '^cd ','cd /d ','') " add /d switch to change drives
let cmd = '"'.cmd.'"' " enclose in quotes let cmd = '"'.cmd.'"' " enclose in quotes
endif endif
else else
let cmd = 'git clone '.a:bundle.uri.' '.shellescape(a:bundle.path())
let cmd = a:bundle.vcs.' clone '.a:bundle.uri.' '.shellescape(a:bundle.path())
endif endif
silent exec '!'.cmd silent exec '!'.cmd
return 1 return 1


Loading…
Cancel
Save