Skip to content

Instantly share code, notes, and snippets.

@user512
Last active December 28, 2017 20:50
Show Gist options
  • Save user512/d7cd26d25baad826f619ef62150f76d1 to your computer and use it in GitHub Desktop.
Save user512/d7cd26d25baad826f619ef62150f76d1 to your computer and use it in GitHub Desktop.
clone dbc repo
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