Created
January 22, 2013 11:07
-
-
Save robinhayward/4593845 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/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