diff options
author | Sergeanur <s.anureev@yandex.ua> | 2021-02-16 17:08:19 +0100 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2021-02-16 17:08:19 +0100 |
commit | e38467ef3affef25b83daf0c0c3b8a61f04e8a65 (patch) | |
tree | 3628aed1314f21147e7a46f3095fa341088d8044 /printHash.bat | |
parent | fix mailbox particle (diff) | |
parent | PR rules (diff) | |
download | re3-e38467ef3affef25b83daf0c0c3b8a61f04e8a65.tar re3-e38467ef3affef25b83daf0c0c3b8a61f04e8a65.tar.gz re3-e38467ef3affef25b83daf0c0c3b8a61f04e8a65.tar.bz2 re3-e38467ef3affef25b83daf0c0c3b8a61f04e8a65.tar.lz re3-e38467ef3affef25b83daf0c0c3b8a61f04e8a65.tar.xz re3-e38467ef3affef25b83daf0c0c3b8a61f04e8a65.tar.zst re3-e38467ef3affef25b83daf0c0c3b8a61f04e8a65.zip |
Diffstat (limited to 'printHash.bat')
-rw-r--r-- | printHash.bat | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/printHash.bat b/printHash.bat new file mode 100644 index 00000000..ef1cd9d6 --- /dev/null +++ b/printHash.bat @@ -0,0 +1,26 @@ +@echo off + +REM creates version.h with HEAD commit hash +REM params: $1=full path to output file (usually points version.h) + +setlocal enableextensions enabledelayedexpansion + +cd /d "%~dp0" + +break> %1 + +<nul set /p=^"#define GIT_SHA1 ^"^"> %1 + +where git +if "%errorlevel%" == "0" ( goto :havegit ) else ( goto :writeending ) + +:havegit +for /f %%v in ('git rev-parse --short HEAD') do set version=%%v +<nul set /p="%version%" >> %1 + +:writeending + +echo ^" >> %1 +echo const char* g_GIT_SHA1 = GIT_SHA1; >> %1 + +EXIT /B
\ No newline at end of file |