mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-02-05 02:31:01 +08:00
since it is a major version, backward compatibility is not guaranteed WARNING: this tag have been moved to integrate the v6.4 stable version
26 lines
633 B
Bash
Executable File
26 lines
633 B
Bash
Executable File
#!/bin/sh
|
|
|
|
DEF_VER=v7.0_unstable
|
|
|
|
# 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
|
|
# if a commandline argument was given, assume it was a ref that git can interpret
|
|
if [ "$#" -ne 0 ]; then
|
|
GIT_VN=$(git describe --match "v[0-9].[0-9]*" --always --long $*)
|
|
else
|
|
GIT_VN=$(git describe --match "v[0-9].[0-9]*" --dirty --always --long)
|
|
fi
|
|
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
|