gengitrev.bat 481 B

12345678910111213
  1. @echo off
  2. setlocal enableextensions
  3. setlocal enabledelayedexpansion
  4. for /f %%t in ('git describe --tags') do set PAL_GIT_REVISION=%%t
  5. if "!PAL_GIT_REVISION!" == "" (
  6. for %%t in (%~dp0..\.gitignore) do set PAL_GIT_REVISION=%%~tt
  7. )
  8. findstr /c:"#define PAL_GIT_REVISION \"!PAL_GIT_REVISION!\"" "%~dp0..\generated.h" >nul 2>&1
  9. if errorlevel 1 (
  10. echo Generating Git revision header... 1>&2
  11. echo #define PAL_GIT_REVISION "!PAL_GIT_REVISION!" > "%~dp0..\generated.h"
  12. )
  13. exit /b 0