summaryrefslogtreecommitdiffhomepage
path: root/scripts/version.sh
blob: 9a965dc8621db73aaf613b2918b4dd5fd60b9434 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/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
		git describe --match '[0-9]*.[0-9]*.[0-9]*' 2>/dev/null \
			| sed -e 's/-/-git-/'
	else
		sed 's/$/-git/' < VERSION
	fi
else
	cat VERSION
fi