From 67d3beb5cce9e18e481dab7abff50fe61d802954 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 10 Jan 2015 18:16:03 -0500 Subject: [PATCH] Improve release script --- scripts/make-release.sh | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/scripts/make-release.sh b/scripts/make-release.sh index 90502d2..520ba50 100755 --- a/scripts/make-release.sh +++ b/scripts/make-release.sh @@ -1,19 +1,29 @@ #!/bin/sh if [ $# -eq 0 ]; then - echo 1>&2 "$0: version number missing" + echo 1>&2 "Usage: $0 [destination]" exit 2 fi VERSION=$1 +DESTINATION=$2 APP="miniflux" +if [ -z "$2" ] +then + DESTINATION=~/Devel/websites/$APP +fi + # tag the release git tag -a v$VERSION -m "Version $VERSION" && git push origin v$VERSION || exit 2 # create the archive -git archive v$VERSION -o ~/Devel/websites/$APP/$APP-$VERSION.zip +git archive --format=zip --prefix=$APP/ v$VERSION -o $DESTINATION/$APP-$VERSION.zip -cd ~/Devel/websites/$APP/ -unlink $APP-latest.zip -ln -s $APP-$VERSION.zip $APP-latest.zip \ No newline at end of file +cd $DESTINATION + +if [ -L $APP-latest.zip ] +then + unlink $APP-latest.zip + ln -s $APP-$VERSION.zip $APP-latest.zip +fi