Created
September 16, 2009 20:19
-
-
Save dbgrandi/188171 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env ruby | |
# | |
# grab a full copy of all my github code. | |
# | |
# assumptions: github.user and github.token are set in git | |
# | |
require 'yaml' | |
user = `git config --get github.username`.strip | |
token = `git config --get github.token`.strip | |
results = `curl -s -F 'login=#{user}' -F 'token=#{token}' http://github.com/api/v2/yaml/repos/show/#{user}` | |
yaml_results = YAML.load results | |
yaml_results['repositories'].each do |repo| | |
print"Grabbing #{repo[:name]}..." | |
`mkdir #{repo[:name]}` | |
`cd #{repo[:name]}` | |
`git clone [email protected]:#{user}/#{repo[:name]}.git` | |
puts "done" | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment