uvg266/tools/version.sh

14 lines
331 B
Bash
Raw Normal View History

2016-03-09 12:44:48 +00:00
#!/bin/sh
cd "$(dirname "$0")"
cd ..
if type git >/dev/null 2>/dev/null && [ -d .git ]; then
version="$(git describe --dirty --tags --match 'v*')"
version="${version} $(git log -1 --pretty=format:%cd --date=short)"
2016-03-09 12:44:48 +00:00
else
version="v$(awk '/#define KVZ_VERSION/ { print $3 }' src/global.h)"
2016-03-09 12:44:48 +00:00
fi
printf '%s\n' "$version"