Sha256: 3188cd812d8ed933fe0f2fa5527a2b1e9aa5afa93cee990b7252f4fcb61731ba
Contents?: true
Size: 700 Bytes
Versions: 12
Compression:
Stored size: 700 Bytes
Contents
# encoding: utf-8 # === Helpers === # def submodules(&block) File.foreach(File.join(File.dirname(__FILE__), "..", ".gitmodules")) do |line| if line.match(%r{submodule "(.+)"}) block.call($1) end end end # === Tasks === # namespace :submodules do desc "Init submodules" task :init do sh "git submodule init" end desc "Update submodules" task :update do submodules do |path| if File.directory?(path) && File.directory?(File.join(path, ".git")) Dir.chdir(path) do puts "=> #{path}" sh "git reset --hard" sh "git fetch" sh "git reset origin/master --hard" puts end end end end end
Version data entries
12 entries across 12 versions & 4 rubygems