tools/version.sh: Fix the version retrieved from GIT.
Use the branch's tag if one exist otherwise use the most recent one. Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
This commit is contained in:
parent
48ba0bb30a
commit
076d89907f
1 changed files with 3 additions and 5 deletions
|
|
@ -86,12 +86,10 @@ done
|
|||
OUTFILE=$1
|
||||
|
||||
if [ -z ${VERSION} ] ; then
|
||||
VERSION=`git -C ${WD} tag --sort=taggerdate | tail -1 | cut -d'-' -f2`
|
||||
VERSION=`git -C ${WD} describe 2>/dev/null | tail -1 | cut -d'-' -f2`
|
||||
|
||||
# Earlier tags used the format "major.minor", append a "0" for a patch.
|
||||
|
||||
if [[ ${VERSION} =~ ^([0-9]+[\.][0-9]+)$ ]] ; then
|
||||
VERSION=${VERSION}.0
|
||||
if [[ ! ${VERSION} =~ ([0-9]+).([0-9]+).([0-9]+) ]] ; then
|
||||
VERSION=`git -C ${WD} tag --sort=v:refname | tail -1 | cut -d'-' -f2`
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue