Created
October 15, 2019 07:58
-
-
Save tonyyates/d8ec2b00af54b724f323d984f3e910b1 to your computer and use it in GitHub Desktop.
Simple bash script for looping through an org and downloading all repos for save keeping
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
#!/bin/bash | |
ORG=$1 | |
echo $ORG | |
mkdir $ORG | |
cd $ORG | |
curl -H 'Authorization: token <insert>' -s https://api.github.com/orgs/$ORG/repos | ruby -rjson -e 'JSON.load(STDIN.read).each {|repo| %x[git clone #{repo["ssh_url"]} ]}' | |
cd .. | |
tar -cvf $ORG-$(date +%Y-%m-%d).tar.gz $ORG/* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment