Files
dvdisaster/scripts/time-stamper.bash
Stéphane Lesimple dc53597e8e chore: rename CLI version to NOGUI in the version tag
As CLI is already #defined, we couldn't stringify it properly
and we ended up with 1 in the version tag
2020-09-05 00:24:23 +02:00

22 lines
589 B
Bash
Executable File

#!/usr/bin/env bash
build=$(grep BUILDNUM $1 2>/dev/null | cut -d\ -f3)
build=$((build+1))
cat >$1 <<EOF
#ifdef CLI
#define FLAVOR NOGUI
#else
#define FLAVOR GUI
#endif
#define STRINGIFY(x) #x
#define TOSTRING(x) STRINGIFY(x)
EOF
echo "#define BUILDNUM $build" >>$1
if git describe >/dev/null 2>/dev/null; then
gitver=$(git describe --tags --dirty)
echo "#define BUILD \"$gitver-\" TOSTRING(FLAVOR) \"-speed47.build$build\"" >>$1
else
echo "#define BUILD TOSTRING(FLAVOR) \"-speed47.build$build\"" >>$1
fi
date=$(date +"%d.%m.%y (%A, %H:%M)")
echo "#define BDATE \"$date\"" >>$1