Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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."
Add Comment
Please, Sign In to add comment