gengitrev 414 B

123456789101112131415161718
  1. #!/bin/bash
  2. PAL_GIT_REVISION=$(git describe --tags 2> /dev/null)
  3. if [ -z "$PAL_GIT_REVISION" ]; then
  4. PAL_GIT_REVISION=$(date -d @$(stat -c %Y ../.gitignore) +"%F %T")
  5. fi
  6. LINE="#define PAL_GIT_REVISION \"$PAL_GIT_REVISION\""
  7. FILE="$(dirname $0)/../generated.h"
  8. grep -F "$LINE" "$FILE" >/dev/null 2>&1
  9. if [ $? -ne 0 ]; then
  10. echo Generating Git revision header... 1>&2
  11. echo "$LINE" > "$FILE"
  12. fi
  13. echo -ne