Browse Source

Added support for repositories on Launchpad

pull/55/head
Øystein Walle 15 years ago
parent
commit
1fabba0379
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)
let arg = a:arg
let vcs = 'git'
if arg =~? '^\s*\(gh\|github\):\S\+'
\ || arg =~? '^[a-z0-9][a-z0-9-]*/[^/]\+$'
let uri = 'https://github.com/'.split(arg, ':')[-1]
@ -49,11 +50,15 @@ func! s:parse_name(arg)
\ || arg =~? '\.git\s*$'
let uri = arg
let name = split( substitute(uri,'/\?\.git\s*$','','i') ,'\/')[-1]
elseif arg =~? '^lp:'
let uri = arg
let name = split (uri, ':')[-1]
let vcs = 'bzr'
else
let name = arg
let uri = 'https://github.com/vim-scripts/'.name.'.git'
endif
return {'name': name, 'uri': uri }
return {'name': name, 'uri': uri, 'vcs': vcs }
endf
func! s:rtp_rm_a()


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

@ -66,17 +66,17 @@ func! s:helptags(rtp) abort
endf
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
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'))
let cmd = substitute(cmd, '^cd ','cd /d ','') " add /d switch to change drives
let cmd = '"'.cmd.'"' " enclose in quotes
endif
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
silent exec '!'.cmd
return 1


Loading…
Cancel
Save