You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
457 B

  1. #!/bin/sh
  2. GIT=$(which git)
  3. if [ "${GIT}" = "" ]; then
  4. exit 0
  5. fi
  6. VERSION=$(git describe --always --tags --dirty)
  7. if [ $? -ne 0 ]; then
  8. VERSION=$(cat VERSION)
  9. fi
  10. if [ "${VERSION}" = "" ]; then
  11. VERSION="unknown"
  12. fi
  13. echo -n "${VERSION}" > VERSION
  14. grep -q \"${VERSION}\" src/version.hpp
  15. RV=$?
  16. if [ $RV -ne 0 ]; then
  17. echo "#pragma once" > src/version.hpp
  18. echo "static const char MERGERFS_VERSION[] = \"${VERSION}\";" >> src/version.hpp
  19. fi