btstack/tool/get_git_version.sh
2021-05-09 22:47:16 +02:00

18 lines
248 B
Bash
Executable File

#!/usr/bin/env sh
# get tag from git
tag=`git tag --points-at HEAD`
# get git version
commit=`git rev-parse --short HEAD`
# use tag if available
if [ -z "$tag" ]
then
version=${commit}
else
version=${tag}-${commit}
fi
echo "${version}"