Skip to content

Commit

Permalink
Use git tags over last merge to get last version number.
Browse files Browse the repository at this point in the history
Signed-off-by: Brian Maher <[email protected]>
  • Loading branch information
bmaher committed May 21, 2019
1 parent 9b380b6 commit b8d1a2f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions check_version.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#! /bin/bash

LAST_MERGE=$(git log --pretty="format:%H" --merges -n 1)
VERSION_FILE="pyproject.toml"
PREVIOUS_VERSION=$(git show $LAST_MERGE:$VERSION_FILE | grep version | awk '{print $3}')
CURRENT_VERSION=$(grep -m 1 version $VERSION_FILE | awk '{print $3}')
PREVIOUS_VERSION=$(git describe --abbrev=0 --tags)
PREVIOUS_VERSION=${PREVIOUS_VERSION#?}
CURRENT_VERSION=$(grep -m 1 version $VERSION_FILE | awk '{print $3}' | sed -e 's/^"//' -e 's/"$//')

if [ $CURRENT_VERSION == $PREVIOUS_VERSION ]; then
echo "ERROR: Version has not been updated in '$VERSION_FILE'!"
Expand Down

0 comments on commit b8d1a2f

Please sign in to comment.