-
Notifications
You must be signed in to change notification settings - Fork 0
/
getGitHash.bat
23 lines (20 loc) · 1023 Bytes
/
getGitHash.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
@ECHO OFF
REM This script generates a .cpp file containing the current git hash string
REM This is the file to which output will be written
SET outputPath="%1src/"
SET outputFile=gitHash.cpp
FOR /f %%i IN ('git describe --tags --abbrev^=0') DO SET gitTag=%%i
FOR /f %%i IN ('git rev-parse --short HEAD') DO SET gitHash=%%i
REM ECHO outputPath = %outputPath%
REM ECHO outputFile = %outputFile%
ECHO gitTag = %gitTag%
ECHO gitHash = %gitHash%
@ECHO // File: %outputFile%> %outputPath%%outputFile%
@ECHO // Auth: getGitHash.bat>> %outputPath%%outputFile%
@ECHO // Desc: Automatically generated file containing latest git hash.>> %outputPath%%outputFile%
@ECHO.>> %outputPath%%outputFile%
@ECHO // Local headers>> %outputPath%%outputFile%
@ECHO #include "pointPickerApp.h">> %outputPath%%outputFile%
@ECHO.>> %outputPath%%outputFile%
@ECHO const wxString PointPickerApp::versionString = _T("%gitTag%");>> %outputPath%%outputFile%
@ECHO const wxString PointPickerApp::gitHash = _T("%gitHash%");>> %outputPath%%outputFile%