This repository has been archived on 2023-08-11. You can view files and clone it, but cannot push or open issues or pull requests.
plugin/scripts/version.sh

16 lines
431 B
Bash
Executable File

#!/bin/sh
TVER=`cat src/version.h | grep '#define VER_REV'`
COMMIT=`git rev-list -1 HEAD -- .`
VER=`git describe --tags --always $COMMIT`
if [ "$TVER" != "#define VER_REV \"$VER\"" ]; then
DATE_REV=`git show -s --format=format:"%ci" $VER`
echo "#ifndef VERSION_H" > src/version.h
echo "#define VERSION_H" >> src/version.h
echo "#define VER_REV \"$DATE_REV ($VER)\"" >> src/version.h
echo "#endif" >> src/version.h
fi