Improve the way submodules are updated [Close #153]

Also updated all plugins to their latest master versions.
This commit is contained in:
Yan Pritzker
2012-10-08 21:38:21 -07:00
parent d49fc4cbe9
commit 1f0693ce1d
21 changed files with 43 additions and 36 deletions

View File

@@ -56,7 +56,7 @@ Upgrading is easy.
```bash ```bash
cd ~/.yadr cd ~/.yadr
git pull origin master git pull origin master
rake install rake update
``` ```
# What's included, and how to customize? # What's included, and how to customize?
@@ -455,10 +455,6 @@ YADR comes with a dead simple plugin manager that just uses git submodules, with
yav -u https://github.com/airblade/vim-rooter yav -u https://github.com/airblade/vim-rooter
You can update all the plugins easily:
yuv
Delete a plugin (Coming Soon) Delete a plugin (Coming Soon)
ydv -p airblade-vim-rooter ydv -p airblade-vim-rooter

View File

@@ -30,12 +30,22 @@ task :install => [:submodules] do
success_msg("installed") success_msg("installed")
end end
task :update => [:install] do
#TODO: for now, we do the same as install. But it would be nice
#not to clobber zsh files
end
desc "Init and update submodules." desc "Init and update submodules."
task :submodules do task :submodules do
puts "======================================================" puts "======================================================"
puts "Downloading YADR submodules...please wait" puts "Downloading YADR submodules...please wait"
puts "======================================================" puts "======================================================"
sh('git submodule update --init --recursive')
run %{
cd $HOME/.yadr
git submodule foreach 'git fetch origin; git checkout master; git reset --hard origin/master; git submodule update --recursive; git clean -dfx'
git clean -dfx
}
puts puts
end end
@@ -45,7 +55,7 @@ task :default => 'install'
private private
def run(cmd) def run(cmd)
puts puts
puts "[Installing] #{cmd}" puts "[Running] #{cmd}"
`#{cmd}` unless ENV['DEBUG'] `#{cmd}` unless ENV['DEBUG']
end end

12
bin/yadr/yadr-update-plugins Executable file
View File

@@ -0,0 +1,12 @@
#!/usr/bin/env ruby
require File.join(File.dirname(__FILE__), 'default_libs')
GitStyleBinary.command do
version "yadr-update-plugins 1.0"
short_desc "Update all plugins to latest versions from github"
run do |command|
`cd $HOME/.yadr && rake submodules`
end
end

View File

@@ -1,12 +0,0 @@
#!/usr/bin/env ruby
require File.join(File.dirname(__FILE__), 'default_libs')
GitStyleBinary.command do
version "yadr-vim-update-plugins 1.0"
short_desc "Update all vim plugins to latest versions from github"
run do |command|
`cd "#{$yadr}" && git submodule foreach git pull origin master`
end
end

View File

@@ -5,7 +5,8 @@ yadr=$HOME/.yadr
# YADR support # YADR support
alias yav='yadr vim-add-plugin' alias yav='yadr vim-add-plugin'
alias yuv='yadr vim-update-plugins' alias yuv='yadr update-plugins' #FIXME: backwards compatibility. Kill me after Jan 1, 2013
alias yup='yadr update-plugins'
alias yip='yadr init-plugins' alias yip='yadr init-plugins'
# PS # PS