We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0ec371f commit 3759642Copy full SHA for 3759642
scripts/version.sh
@@ -36,11 +36,11 @@ if [[ -z ${tag_list} ]]; then
36
else
37
current_commit=$(git rev-parse HEAD)
38
# Try to find the last tag that contains the current commit
39
- last_tag=$(git tag --contains "$current_commit" --sort=version:refname | head -n 1)
+ last_tag=$(git tag --contains "$current_commit" --sort=-version:refname | head -n 1)
40
# If there is no tag that contains the current commit,
41
# get the latest tag sorted by semver.
42
if [[ -z "${last_tag}" ]]; then
43
- last_tag=$(git tag --sort=version:refname | tail -n 1)
+ last_tag=$(git tag --sort=-version:refname | head -n 1)
44
fi
45
46
0 commit comments