Skip to content

Instantly share code, notes, and snippets.

@robinhayward
Created January 22, 2013 11:07
Show Gist options
  • Save robinhayward/4593845 to your computer and use it in GitHub Desktop.
Save robinhayward/4593845 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# Release script
#
# A zip file will be produced with a release date and saved to the desktop
#
if [ "$1" = "" ]
then
echo "Error: $0 No project name given"
exit
fi
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo $DIR
CURRENT_DIR="`pwd`"
HOME = "~/"
HOME = eval HOME
FILES_TO_ZIP="./"
DATE=$(date +%Y%m%d-%H%M%S)
FILE_NAME="$1-$DATE.zip"
ZIP_TARGET_FOLDER="$HOME/Desktop/"
ZIP_TARGET="$ZIP_TARGET_FOLDER/$FILE_NAME"
pushd $CURRENT_DIR
zip -r $ZIP_TARGET $FILES_TO_ZIP -x@$DIR/ignore.lst
popd
echo "Release saved to Desktop: $FILE_NAME"
open $ZIP_TARGET_FOLDER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment