Created
June 29, 2017 17:27
-
-
Save sofar/088fc688f8d3581acd26a5661cbcaf4a to your computer and use it in GitHub Desktop.
lists git projects in organization by ssh url
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" | |
while true; do | |
((PAGE++)) | |
URL="https://api.github.com/users/$ORG/repos?per_page=20" | |
if [ $PAGE -gt 1 ]; then | |
URL="$URL&page=$PAGE" | |
fi | |
NEW=( `curl -i "$URL" | grep ssh_url | cut -d'"' -f4 `) | |
LIST=( ${LIST[@]} ${NEW[@]} ) | |
if [ ${#NEW[@]} -lt 20 ]; then | |
break | |
fi | |
done | |
for E in ${LIST[@]}; do | |
echo $E | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment