#!/bin/bash if [[ $# -eq 0 ]] ; then echo "Please enter a version number:" read VERSION else VERSION=$1 fi if [[ -z "$VERSION" ]] ; then echo "Sorry, I need a version number!" exit 0 fi echo "Enter your multiline changelog and ctrl-d on a new line when done:" MSG=$(cat) if [[ -z "$MSG" ]] ; then echo "Sorry, I need a changelog for this release!" exit 0 fi NAME=${PWD##*/} git tag -a $VERSION -m "$MSG" git push origin $VERSION git-archive-all --force-submodules --prefix $NAME/ ~/Desktop/$NAME-$VERSION.zip echo "Tagged in bitbucket and Packaged as $NAME-$VERSION.zip on your desktop."