make the set-version script support the versison number when it is formatted with .SNAPSHOT and -SNAPSHOT
diff --git a/set-version.sh b/set-version.sh
index fa0509f..712d207 100755
--- a/set-version.sh
+++ b/set-version.sh
@@ -24,6 +24,15 @@
reg="<version>(.*)-SNAPSHOT<\/version>"
line=`awk '{if ($1 ~ /'$reg'/){print $1}}' < pom.xml | head -1`
OLD_VERSION=`echo "$line" | awk 'match($0, "<version>(.*)-SNAPSHOT</version>", a) { print a[1] }'`
+ if [ -z "$OLD_VERSION" ]; then
+ reg="<version>(.*)\.SNAPSHOT<\/version>"
+ line=`awk '{if ($1 ~ /'$reg'/){print $1}}' < pom.xml | head -1`
+ OLD_VERSION=`echo "$line" | awk 'match($0, "<version>(.*)\.SNAPSHOT</version>", a) { print a[1] }'`
+ if [ -z "$OLD_VERSION" ]; then
+ echo "Unable to extract the old version from the pom.xml"
+ exit 2
+ fi
+ fi
fi
# reconstruct the version and buildNumber aka qualifier.