Permalink
Browse files

chore: make ./release_notes.sh create docs/_posts/$DATE_YMD-$VERS-rel…

…ease.md file
  • Loading branch information...
vlsi committed Jul 12, 2017
1 parent d6fe07d commit e00d4571bb6ca24c8f93956b59fd1c9a14131394
Showing with 22 additions and 1 deletion.
  1. +22 −1 release_notes.sh
@@ -1,8 +1,29 @@
#!/bin/sh
#!/bin/bash


CURRENT_VERSION=`mvn -B -N org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -v '\['`
VERS=${CURRENT_VERSION/-SNAPSHOT}
DATE_YMD=$(date '+%Y-%m-%d')
RELEASE_FILE=$(find docs/_posts -name "*-$VERS-release.md" | head -n 1)
if [[ "x$RELEASE_FILE" == "x" ]]; then
RELEASE_FILE=docs/_posts/$DATE_YMD-$VERS-release.md
fi
echo file: $RELEASE_FILE

if [ -f $RELEASE_FILE ]; then
if [[ "x$1" == "x-o" ]]; then
echo Removing file $RELEASE_FILE
rm "$RELEASE_FILE"
fi
fi

if [ -f $RELEASE_FILE ]; then
echo File $RELEASE_FILE already exists. If you want to overwrite it, pass -o parameter
else
# Makes all the output get printed to the file as well (concept from http://stackoverflow.com/a/3403786/267224)
exec > >(tee -a $RELEASE_FILE)
exec 2>&1
fi

PREV_VERSION=`git describe --match 'REL*' --abbrev=0`

0 comments on commit e00d457

Please sign in to comment.