Files
paparazzi/paparazzi_version
T
2013-08-09 18:35:20 +02:00

21 lines
416 B
Bash
Executable File

#!/bin/sh
DEF_VER=v5.1_devel
# First try git describe (if running on a git repo),
# then use default version from above (for release tarballs).
if test -d .git -o -f .git
then
GIT_VN=$(git describe --match "v[0-9].[0-9]*" --dirty --always --long)
if echo "$GIT_VN" | grep -Eq "^v[0-9].[0-9]"
then
VN="$GIT_VN"
else
VN="$DEF_VER"-none-g"$GIT_VN"
fi
else
VN="$DEF_VER"
fi
echo $VN