Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1ca5dc0

Browse files
chore: always use the latest released version tag when building (#13556)
* chore: always use the latest released version tag when building* Update version.shCo-authored-by: Dean Sheather <dean@deansheather.com>---------Co-authored-by: Dean Sheather <dean@deansheather.com>
1 parent28228f1 commit1ca5dc0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

‎scripts/version.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,14 @@ if ! [[ ${remote_url} =~ [@/]github.com ]] && ! [[ ${remote_url} =~ [:/]coder/co
4141
log
4242
last_tag="v2.0.0"
4343
else
44-
last_tag="$(git describe --tags --abbrev=0)"
44+
current_commit=$(git rev-parse HEAD)
45+
# Try to find the last tag that contains the current commit
46+
last_tag=$(git tag --contains"$current_commit" --sort=version:refname| head -n 1)
47+
# If there is no tag that contains the current commit,
48+
# get the latest tag sorted by semver.
49+
if [[-z"${last_tag}" ]];then
50+
last_tag=$(git tag --sort=version:refname| tail -n 1)
51+
fi
4552
fi
4653

4754
version="${last_tag}"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp