Created
April 23, 2010 14:25
-
-
Save tadelv/376582 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
#list through the current folder and call git pull on each repository | |
home = ARGV[0] == nil ? Dir.pwd : ARGV[0] | |
home_d = Dir.open(home) | |
home_count = home_d.count | |
c_idx = 1 | |
home_d.each do |current| | |
c_dir = "#{home}/#{current}" | |
if File::directory?(c_dir) && current != ".." && current != "." | |
Dir.chdir("#{home}/#{current}") | |
if File::exists?(".git") | |
puts "="*80 | |
puts "pulling #{current}" | |
system("git pull") | |
end | |
#print("\r","="*c_idx,"#{c_idx}/#{home_count}") | |
Dir.chdir(home) | |
c_idx += 1 | |
end | |
end | |
puts | |
puts "all done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment