Browse Source

initial working ver. Still lot's of issues

- v gets ignored when set as an option
v
gmarik 14 years ago
parent
commit
3285e0e82a
2 changed files with 19 additions and 14 deletions
  1. +2
    -2
      autoload/vundle/config.vim
  2. +17
    -12
      autoload/vundle/installer.vim

+ 2
- 2
autoload/vundle/config.vim View File

@ -38,11 +38,11 @@ func! s:parse_options(opts)
endf
func! s:parse_name(arg)
let opts = {}
let git_proto = exists('g:vundle_default_git_proto') ? g:vundle_default_git_proto : 'https'
let args = split(a:arg, '\s\+')
let arg = args[0]
let opts = {'v': 'master'}
" Bundle 'gmarik/vundle v0.8'
if len(args) == 2
let revision = args[1]
@ -66,7 +66,7 @@ func! s:parse_name(arg)
let uri = git_proto.'://github.com/vim-scripts/'.name.'.git'
endif
return extend(opts, {'name': name, 'uri': uri, 'name_spec': arg })
return extend(opts, {'name': name, 'uri': uri, 'name_spec': a:arg })
endf
func! s:rtp_rm_a()


+ 17
- 12
autoload/vundle/installer.vim View File

@ -196,23 +196,28 @@ endf
func! s:sync(bang, bundle) abort
let git_dir = expand(a:bundle.path().'/.git/', 1)
let is_dir = isdirectory(git_dir)
let revision = 'master'
if has_key(a:bundle, 'v') && !empty(a:bundle['v'])
let revision = a:bundle['v']
if is_dir && !(a:bang)
return 'todate'
end
if isdirectory(git_dir)
if !(a:bang) | return 'todate' | endif
let cmd = 'cd '.shellescape(a:bundle.path()).' && git pull '.a:bundle.uri.' '.revision.':'.revision
let cd_cmd = 'cd '.shellescape(a:bundle.path())
if (has('win32') || has('win64'))
let cd_cmd = substitute(cmd, '^cd ','cd /d ','') " add /d switch to change drives
endif
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
if is_dir
let cmd = cd_cmd.' && git pull '.a:bundle.uri
else
let cmd = 'git clone '.a:bundle.uri.' '.shellescape(a:bundle.path())
let cmd = 'git clone '.a:bundle.uri.' '.shellescape(a:bundle.path()).' && '.cd_cmd
endif
let v = a:bundle['v']
let cmd .= ' && git checkout '.v
if (has('win32') || has('win64'))
let cmd = '"'.cmd.'"' " enclose in quotes
endif
let out = s:system(cmd)


Loading…
Cancel
Save