Archived
1
0
Fork 0
This repository has been archived on 2026-05-10. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
dlight/VERSION-GEN
2013-08-22 10:11:50 +02:00

18 lines
372 B
Bash

#!/bin/sh
VERSION=$(git describe --always --tags --match "v[0-9]*" HEAD 2>/dev/null)
if [ -n "$(git status --porcelain)" ]; then
VERSION="${VERSION}-dirty"
fi
if [ -f "${1}" ]; then
OLD=$(cat ${1} | sed 's/VERSION = //')
else
OLD=unset
fi
if [ "${VERSION}" != "${OLD}" ]; then
#echo >&2 "VERSION = ${VERSION}"
echo "VERSION = ${VERSION}" > ${1}
fi