2018-09-04 07:23:01 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${0}")" && pwd)"
|
|
|
|
GIT_DIR="${SCRIPT_DIR}/../.git"
|
|
|
|
|
|
|
|
if test -d "${GIT_DIR}" ; then
|
|
|
|
if type git >/dev/null 2>&1 ; then
|
2020-09-27 22:44:50 +08:00
|
|
|
gitstr=$(git describe --match '[0-9]*.[0-9]*.*' 2>/dev/null)
|
2020-09-07 02:58:21 +08:00
|
|
|
if test "x$?" != x0 ; then
|
|
|
|
sed 's/$/-git/' < VERSION
|
|
|
|
else
|
2020-09-27 22:41:54 +08:00
|
|
|
printf "%s\n" "$gitstr" | sed -e 's/-g/-git-/'
|
2020-09-07 02:58:21 +08:00
|
|
|
fi
|
2018-09-04 07:23:01 +08:00
|
|
|
else
|
|
|
|
sed 's/$/-git/' < VERSION
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
cat VERSION
|
|
|
|
fi
|