public
Last active

Mirror a user's gists

  • Download Gist
project.bash
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
#!/bin/sh
 
GIST_USER=sbp
 
if [ "$1" = "update" ]
then
curl -s http://gist.github.com/api/v1/json/gists/$GIST_USER |
python -c 'import sys, json
for gist in json.loads(sys.stdin.read())["gists"]:
print gist["repo"]' | while read GIST
do if [ ! -d $GIST ]
then git submodule add git://gist.github.com/$GIST.git
echo Created $GIST submodule
fi
done
 
elif [ "$1" = "sync" ]
then
git submodule foreach git pull
 
else
 
echo Options:
echo update - Gets any new gists for user
echo sync - Keep existing gists synced with server
 
fi

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.