Skip to content
This repository has been archived by the owner on Jan 11, 2019. It is now read-only.

Commit

Permalink
Merge branch 'add_dev_update_submodules' into my_pulls
Browse files Browse the repository at this point in the history
closes carlhuda#284

* add_dev_update_submodules:
  Rakefile: Add a task to easly update all submodules.

Conflicts:
	Rakefile
  • Loading branch information
kalbasit committed Nov 2, 2011
2 parents 3bf380f + 357dbd4 commit 12a3bfc
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,38 @@ task :link_vim_conf_files do
end
end

# Get a list of submodules
#
# @return [Array] of submodules
def submodules
`git submodule`.split("\n").collect { |s| s.split(" ")[1] }
end

# Update a submodule
#
# @param [String] The submodule to update (relative path)
# @param [String] The branch we're tracking
def update_submodule(submodule, branch = "master")
Dir.chdir submodule do
puts
puts "*" * 40
puts "*#{"Updating #{submodule}".center(38)}*"
puts "*" * 40
puts
sh "git checkout #{branch}"
sh "git pull"
end
end

namespace :dev do
desc "Update submodules"
task :update_submodules do
submodules.each do |submodule|
update_submodule(submodule)
end
end
end

desc "Create necessary folders."
task :folders do
Janus::VIM.folders.each do |folder|
Expand Down

0 comments on commit 12a3bfc

Please sign in to comment.