Created
January 18, 2018 14:14
-
-
Save fedescarpa/2da2a0a828aa420f63933ac1227ada8e 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
#!/bin/bash | |
set -e | |
GITHUB_USERNAME=$1 | |
GITHUB_ORGANIZATION=$2 | |
if [ -z $USERNAME ] || [ -z $ORGANIZATION ]; then | |
echo '[ERROR] Missing arguments. Usage: ' | |
echo '' | |
echo ' clone-repos <GITHUB_USERNAME> <GITHUB_ORGANIZATION>' | |
echo '' | |
exit 1 | |
fi | |
curl -u $GITHUB_USERNAME -s https://api.github.com/orgs/$GITHUB_ORGANIZATION/repos?per_page=500 | ruby -rubygems -e ' | |
require "json" | |
JSON.load(STDIN.read).each do |repo| | |
%x[git clone #{repo["ssh_url"]} ] | |
puts "" | |
end | |
' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment