Skip to content

Instantly share code, notes, and snippets.

@louisswarren
Last active September 21, 2016 11:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save louisswarren/3e7b1f7ffd9114617ad269925e756fb3 to your computer and use it in GitHub Desktop.
Save louisswarren/3e7b1f7ffd9114617ad269925e756fb3 to your computer and use it in GitHub Desktop.
user="louisswarren"
github="https://api.github.com"
pyjsonlines="'\n'.join(r[sys.argv[-1]] for r in json.loads(sys.stdin.read()))"
pycmd="import sys, json; print($pyjsonlines)"
curl -s "$github/users/$user/repos" | python3 -c "$pycmd" git_url |
while read x; do
git clone "$x"
done
if [ ! -d gist ]; then
mkdir gist;
fi
cd gist/
curl -s "$github/users/$user/gists" | python3 -c "$pycmd" git_pull_url |
while read x; do
git clone "$x"
done
cd ../
@louisswarren
Copy link
Author

Need second one to replace https://gist.github.com/ with git@gist.github.com:.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment