From b5f13e0038ef171eacf45ea465bd6c750c1a6000 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Wed, 28 Feb 2018 18:35:09 +0000 Subject: [PATCH] Update set-version to better detect current version --- set-version.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/set-version.sh b/set-version.sh index 61099c3..f882f33 100644 --- a/set-version.sh +++ b/set-version.sh @@ -1,15 +1,19 @@ #!/usr/bin/env bash +cd `dirname $0` +PROJECT=`basename $PWD` + if test $# != 1 then echo "next version missing" exit fi -CURRENT=`grep '' pom.xml |head -n 1| sed 's/.*>\(.*\)<.*/\1/'` +CURRENT=`grep -C 2 "${PROJECT}" pom.xml | grep '' | sed 's/.*>\(.*\)<.*/\1/'` NEXT=$1 echo Updating version from $CURRENT to $NEXT ./mvnw versions:set -DnewVersion=$NEXT -perl -p -i -e "s,$CURRENT