mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-12 01:30:49 +01:00
22 lines
506 B
Bash
22 lines
506 B
Bash
#!/bin/sh
|
|
|
|
# make current git version (overwrites version.h)
|
|
VERSION_NAME=VGMSTREAM_VERSION
|
|
VERSION_FILE=version.h
|
|
|
|
|
|
# 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
|
|
echo "Git version not found, can't autogenerate version.h"
|
|
fi;
|