Last active
December 28, 2017 20:50
-
-
Save user512/d7cd26d25baad826f619ef62150f76d1 to your computer and use it in GitHub Desktop.
clone dbc repo
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 'json' | |
def clone_repo | |
page_num = 1 | |
loop do | |
# replace sf-grasshoppers-2015 with your cohort name | |
json = %x[curl 'https://api.github.com/orgs/sf-grasshoppers-2015/repos?per_page=100&page=#{page_num}' -u <username>:<personal_access_token>] | |
json = JSON.parse(json) | |
break if json.empty? | |
json.each { |repo| %x[git clone #{repo["ssh_url"]} ] } | |
page_num += 1 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment