From b8785d424e6128962750754aa316ab38c34c7c68 Mon Sep 17 00:00:00 2001 From: Deep Singhvi Date: Sun, 29 Dec 2024 20:13:23 -0500 Subject: [PATCH] chore(cli): improve git-version script so that dev releases follow same version as prod (#5505) --- scripts/git-version.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/git-version.sh b/scripts/git-version.sh index a00fe2a3829..e7890bd0104 100755 --- a/scripts/git-version.sh +++ b/scripts/git-version.sh @@ -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