Skip to content

Instantly share code, notes, and snippets.

@ankane
Created January 31, 2013 06:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ankane/4680869 to your computer and use it in GitHub Desktop.
Save ankane/4680869 to your computer and use it in GitHub Desktop.
Clone all Heroku repos
output = %x[heroku apps]
repos = output.split("\n").select{|line| line.length > 0 and line[0..2] != "===" }.map{|line| line.split[0] }
repos.each do |repo|
unless Dir.exists?(repo)
puts %x[git clone git@heroku.com:#{repo}.git]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment