From f842b22eb89771f6bd4ec1dbe529f56c8bdc8b92 Mon Sep 17 00:00:00 2001 From: Michael Bridgen Date: Wed, 24 Dec 2014 12:43:39 +0000 Subject: [PATCH] Do better with checking the changelog Before, this could fail without a message if there was a changelog but no matching line. Also change the changelog format == Release v0.0.1 to == Release 0.0.1 --- bin/release | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/bin/release b/bin/release index 3c0afdc0..7eb4efe2 100755 --- a/bin/release +++ b/bin/release @@ -33,10 +33,9 @@ build() { cd $RELEASE_DIR ## Check that the top changelog entry is this version - latest_changelog=$(grep -o "Release v.*" -m1 ./CHANGELOG.md) - if ! [ `echo "$latest_changelog" | grep -o 'v[^ ]*'` == $LATEST_TAG ]; then - echo -e "\u2757 Latest changelog entry $latest_changelog does not match" >&2 - echo "the latest tag $LATEST_TAG" >&2 + if ! latest_changelog=$(grep -o "== Release [0-9].*" -m1 ./CHANGELOG.md) || \ + ! [ `echo "$latest_changelog" | grep -o '[0-9][^ ]*'` == "$VERSION" ]; then + echo -e "\u2757 Latest changelog entry \"$latest_changelog\" does not match the release version $VERSION" >&2 exit 1 fi @@ -61,9 +60,9 @@ build() { fi ## Run tests with the distributables, including version check - v=$(./weaver/weaver --version) - if ! [ "$v" == "weaver $VERSION" ]; then - echo "Version of distributable "$v" does not match tag $LATEST_TAG" >&2 + v=$(./weaver/weaver --version | grep -o '[0-9].*') + if ! [ "$v" == "$VERSION" ]; then + echo "Version of distributable "$v" does not match release version $VERSION" >&2 exit 1 fi