Skip to content

Commit

Permalink
scripts: add missing version script
Browse files Browse the repository at this point in the history
  • Loading branch information
7Ji committed Apr 16, 2024
1 parent e977d20 commit e67a70b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scripts/build-only-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[[ -e .git ]] || exit 1
tag=$(git describe --abbrev=0 --tags ${TAG_COMMIT} 2>/dev/null)
tag=${tag#v}
commit=$(git rev-list --abbrev-commit --tags --max-count=1)
date=$(git log -1 --format=%cd --date=format:"%Y%m%d")
version="${tag#v}-${commit}-${date}"
[[ "$(git diff --stat)" ]] && suffix='-dirty' || suffix=''
printf '%s' "${version}${suffix}"

0 comments on commit e67a70b

Please sign in to comment.