Created
March 30, 2017 00:38
-
-
Save KensoDev/1f11a08ffbce14aa66048f1cd40063fd 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
| all: | |
| force: | |
| token=<your-github-token> | |
| user=<your-github-username> | |
| org=<your-github-organization> | |
| auth_opt=-u $(user):$(token) | |
| # note: not all repos are in there! hitting the page limit of 30. | |
| x.repos.json: force | |
| curl -Ks $(auth_opt) https://api.github.com/orgs/$(org)/repos?per_page=100 \ | |
| > $@ | |
| clone-all: x.repos.json | |
| cat x.repos.json \ | |
| | jq -M -r '.[]|.ssh_url' \ | |
| | while read url; do (test -e $$(echo $$url | sed 's|.*/\(.*\)\.git|\1|') || git clone $$url ); done | |
| list-all: x.repos.json | |
| cat x.repos.json \ | |
| | jq -M -r '.[]|.ssh_url' \ | |
| | while read url; do (echo $$url); done | |
| pull-all: | |
| for d in ./*; do echo $$d; (cd $$d; git pull); done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment