Skip to content

Commit

Permalink
chore(cli): improve git-version script so that dev releases follow sa…
Browse files Browse the repository at this point in the history
…me version as prod (#5505)
  • Loading branch information
dsinghvi authored Dec 30, 2024
1 parent 59791ff commit b8785d4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/git-version.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env bash

# if the current commit is tagged, then should then ignore the tag
# if the current commit is tagged, return the tag, otherwise describe with nearest tag
tag="$(git describe --exact-match --tags HEAD 2> /dev/null || :)"
if [[ -n "$tag" ]]; then
exclude_param="--exclude $tag"
echo "$tag"
else
git describe --tags --always --first-parent
fi
git describe --tags --always --first-parent $exclude_param

0 comments on commit b8785d4

Please sign in to comment.