def find_git(dir)
git_repo = lambda{|d| Dir.entries(d).include?(’.git’) }
dirs = []
Find.find(dir) do |f |
Find.prune if f == “.”
next if dirs.include? File.basename(f)
if FileTest.directory? f
dirs << f if git_repo[f]
end
end
dirs
end
git_dirs = find_git(GIT_DIR)
puts git_dirs.inspect
git_dirs.each do |repo|
cd repo do
system(‘git pull’)
end
end