File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3- # A script that prints a string identifying the current version of the code
4- # This is used in the build process as a fallback
3+ # Print a string identifying the current version of the code.
4+ # This is used in the build process.
55
66# projectversion=`git describe --tags --long`
77# cleanversion=${projectversion%%-*}
88
99revisioncount=` git log --oneline | wc -l`
1010ts=` date +%Y%m%d.%H%M%S`
1111id=` git rev-parse --short HEAD`
12+ tag=` git tag --points-at HEAD`
1213
1314if git diff --quiet --exit-code HEAD; then
14- echo $id -$revisioncount -snapshot
15+ if [ -z " $tag " ]; then
16+ # clean working dir but untagged commit
17+ echo snapshot-$id -$revisioncount
18+ else
19+ # clean working dir on tagged commit
20+ echo $tag
21+ fi
1522else
16- echo $ts -dev
23+ # dirty working dir
24+ echo dev-$ts
1725fi
You can’t perform that action at this time.
0 commit comments