File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change 11#! /bin/sh
2- TAG=$( git describe --tags --abbrev=0 2> /dev/null)
3- SUFFIX=$( git show -s --format=%ct.%h HEAD)
2+ TAG=$( git tag | grep -E " [0-9]\.[0-9]\.[0-9]" | sort -rn | head -n1)
43
5- if [ -n " ${TAG} " ]; then
6- COMMITS_SINCE_TAG=$( git rev-list ${TAG} .. --count)
7- if [ " ${COMMITS_SINCE_TAG} " -gt 0 ]; then
8- SUFFIX=" dev${COMMITS_SINCE_TAG} .${SUFFIX} "
9- fi
4+ if [ -z " ${TAG} " ]; then
5+ echo " Could not find any tag" 1>&2
6+ exit 1
107else
11- TAG=" 0"
8+ COMMITS_SINCE_TAG=$( git rev-list " ${TAG} " .. --count)
9+ if [ " ${COMMITS_SINCE_TAG} " -gt 0 ]; then
10+ COMMIT_INFO=$( git show -s --format=%ct.%h HEAD)
11+ SUFFIX=" +git.${COMMITS_SINCE_TAG} .${COMMIT_INFO} "
12+ fi
1213fi
1314
14- echo " ${TAG} +git. ${SUFFIX} "
15+ echo " ${TAG}${SUFFIX} "
You can’t perform that action at this time.
0 commit comments