2021-08-08 14:00:58 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2021-08-10 23:51:48 +02:00
|
|
|
# make current git version (overwrites version_auto.h)
|
2021-08-08 14:00:58 +02:00
|
|
|
VERSION_NAME=VGMSTREAM_VERSION
|
2021-08-10 23:51:48 +02:00
|
|
|
VERSION_FILE=version_auto.h
|
2021-08-08 14:00:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
# test if git exists
|
|
|
|
if ! command -v git > /dev/null ; then
|
|
|
|
VERSION=""
|
|
|
|
else
|
|
|
|
VERSION=$(git describe --always 2>&1 | tr : _ )
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# ignore git stderr "fatal:*" or blank
|
|
|
|
if [[ $VERSION != fatal* ]] && [ ! -z "$VERSION" ] ; then
|
|
|
|
echo "#define $VERSION_NAME \"$VERSION\" /* autogenerated */" > $VERSION_FILE
|
|
|
|
else
|
2021-08-10 23:51:48 +02:00
|
|
|
echo "Git version not found, can't autogenerate version_auto.h"
|
2021-08-08 14:00:58 +02:00
|
|
|
fi;
|