Skip to content

Instantly share code, notes, and snippets.

@AndrewJDR
Last active August 29, 2015 14:10
Show Gist options
  • Save AndrewJDR/294a0ff60f3c13767338 to your computer and use it in GitHub Desktop.
Save AndrewJDR/294a0ff60f3c13767338 to your computer and use it in GitHub Desktop.
Creates a git repository based off of the handmade hero source zip
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"
@AndrewJDR
Copy link
Author

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.

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