mergerfs/tools/update-version

20 lines
384 B
Plaintext
Raw Normal View History

2018-03-10 09:48:36 +08:00
#!/bin/sh
GIT=$(which git)
if [ "${GIT}" = "" ]; then
exit 0
fi
VERSION=$(git describe --always --tags --dirty)
2018-03-17 11:26:29 +08:00
if [ $? -ne 0 ]; then
exit 0
fi
2018-03-10 09:48:36 +08:00
echo -n "${VERSION}" > VERSION
grep -q \"${VERSION}\" src/version.hpp
RV=$?
if [ $RV -ne 0 ]; then
echo "#pragma once" > src/version.hpp
echo "static const char MERGERFS_VERSION[] = \"${VERSION}\";" >> src/version.hpp
fi