Skip to content

Instantly share code, notes, and snippets.

@dmgottlieb
Last active August 29, 2015 14:27
Show Gist options
  • Save dmgottlieb/3a3cc87770cb507f3786 to your computer and use it in GitHub Desktop.
Save dmgottlieb/3a3cc87770cb507f3786 to your computer and use it in GitHub Desktop.
git post-commit hook to automatically package a love-2d project for distribution as OSX app.
#!/bin/sh
branch=$(git rev-parse --abbrev-ref HEAD $1)
date=""`date +%d`" "`date +%B`", "`date +%Y`
githash="git rev-parse --short HEAD"
echo "Build $githash of $date" > buildinfo
if [ "test" == "$branch" ]; then
# build test distro, Mac and Windows
zip -9 -q -r haystack.love .
cp ./haystack.love ~/Projects/haystack-test/haystack-test.app/Contents/Resources/haystack.love
rm -Rf ~/Dropbox/haystack-test-binaries/haystack-test.app
cp -R ~/Projects/haystack-test/haystack-test.app ~/Dropbox/haystack-test-binaries/
cat ~/Projects/haystack-test/love.exe ./haystack.love > ~/Projects/haystack-test/haystack.exe
rm -Rf ~/Dropbox/haystack-test-binaries/haystack.exe
cp -R ~/Projects/haystack-test/haystack.exe ~/Dropbox/haystack-test-binaries/
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment