Skip to content

Commit

Permalink
Update versionQualifier.sh with changes from similar PPS script.
Browse files Browse the repository at this point in the history
  • Loading branch information
dhendriks committed Aug 4, 2024
1 parent f032e0e commit 72f1644
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions releng/versionQualifier.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@ QUALIFIER_POSTFIX="dev"

if [ $# -gt 0 ]
then
QUALIFIER_POSTFIX=$(echo $1 | sed -e 's/^[^-]*-//')
QUALIFIER_POSTFIX=$(echo $1 | cut -s -d '-' -f2-)
fi

# Get Git last commit date.
GIT_DATE_EPOCH=$(git log -1 --format=%cd --date=raw | cut -d ' ' -f 1)
GIT_DATE=$(date -d @$GIT_DATE_EPOCH -u +%Y%m%d-%H%M%S)

echo "v$GIT_DATE-$QUALIFIER_POSTFIX"
if [ -z "$QUALIFIER_POSTFIX" ]
then
echo "v$GIT_DATE"
else
echo "v$GIT_DATE-$QUALIFIER_POSTFIX"
fi

0 comments on commit 72f1644

Please sign in to comment.