mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-09 12:40:43 +00:00
16 lines
516 B
Batchfile
16 lines
516 B
Batchfile
@echo off
|
|
setlocal
|
|
set DIR=%~dp0
|
|
|
|
echo Updating %DIR%git_info.h
|
|
|
|
for /f %%i in ('git -C %DIR% rev-parse --abbrev-ref HEAD') do set GIT_BRANCH=%%i
|
|
for /f %%i in ('git -C %DIR% rev-parse --short HEAD') do set GIT_REVISION=%%i
|
|
|
|
if "%GIT_BRANCH"=="" set GIT_BRANCH="Unknown";
|
|
if "%GIT_REVIISION"=="" set GIT_REVISION="Unknown";
|
|
|
|
echo // This is an auto generated file > %DIR%git_info.h
|
|
echo const QString GIT_BRANCH="%GIT_BRANCH%"; >> %DIR%git_info.h
|
|
echo const QString GIT_REVISION="%GIT_REVISION%"; >> %DIR%git_info.h
|