Last active
August 29, 2015 14:10
-
-
Save AndrewJDR/294a0ff60f3c13767338 to your computer and use it in GitHub Desktop.
Creates a git repository based off of the handmade hero source zip
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
echo Syntax: | |
echo $0 handmade_hero_nnn_source.zip | |
echo | |
if [ ! -s "$1" ]; then | |
echo "specified file doesn't exist!" | |
exit | |
fi | |
STARTDIR=$PWD | |
mkdir handmade_hero && \ | |
cd handmade_hero && \ | |
unzip ../$1 && \ | |
mkdir handmade_hero_git && \ | |
cd handmade_hero_git && \ | |
git init && \ | |
for HZIP in ../*.zip; do | |
git rm -r . | |
unzip $HZIP && \ | |
git add -A . && \ | |
git commit -m "`basename $HZIP`" && \ | |
rm $HZIP | |
done | |
cd $STARTDIR | |
echo | |
echo "Success! git repo in $PWD/handmade_hero/handmade_hero_git" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On windows, put the script and your source zip in the same directory, then open git bash, cd to that directory, and run:
./handmade_git.sh handmade_hero_nnn_source.zip
Obviously the filename will be different depending upon which zip file you have.