Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions MakeCommitHash.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ exit /b 0

FOR /F "tokens=*" %%g IN ('git rev-parse HEAD') DO (SET UEVR_COMMIT_HASH=%%g)

FOR /F "tokens=*" %%t IN ('git describe --tags --abbrev^=0') DO (SET UEVR_TAG=%%t)
FOR /F "tokens=*" %%t IN ('git describe --tags --always --abbrev^=0') DO (SET UEVR_TAG=%%t)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

able to remove --always switch if not needed

IF "%UEVR_TAG%"=="" (SET UEVR_TAG=no_tag)

FOR /F "tokens=*" %%c IN ('git describe --tags --long') DO (
FOR /F "tokens=*" %%c IN ('git describe --tags --always --long') DO (

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

able to remove --always switch if not needed

FOR /F "tokens=1,2 delims=-" %%a IN ("%%c") DO (
SET UEVR_TAG_LONG=%%a
SET UEVR_COMMITS_PAST_TAG=%%b
Expand All @@ -24,7 +24,7 @@ FOR /F "tokens=*" %%b IN ('git rev-parse --abbrev-ref HEAD') DO (SET UEVR_BRANCH
FOR /F "tokens=*" %%n IN ('git rev-list --count HEAD') DO (SET UEVR_TOTAL_COMMITS=%%n)
IF "%UEVR_TOTAL_COMMITS%"=="" (SET UEVR_TOTAL_COMMITS=0)

FOR /F "tokens=2 delims==" %%a IN ('wmic OS get localdatetime /value') DO (
FOR /F "tokens=*" %%a IN ('powershell -NoProfile -Command "Get-Date -Format yyyyMMddHHmmss"') DO (
SET datetime=%%a
)

Expand All @@ -42,4 +42,4 @@ echo #define UEVR_COMMITS_PAST_TAG %UEVR_COMMITS_PAST_TAG% >> src/CommitHash.aut
echo #define UEVR_BRANCH "%UEVR_BRANCH%" >> src/CommitHash.autogenerated
echo #define UEVR_TOTAL_COMMITS %UEVR_TOTAL_COMMITS% >> src/CommitHash.autogenerated
echo #define UEVR_BUILD_DATE "%day%.%month%.%year%" >> src/CommitHash.autogenerated
echo #define UEVR_BUILD_TIME "%hour%:%minute%" >> src/CommitHash.autogenerated
echo #define UEVR_BUILD_TIME "%hour%:%minute%" >> src/CommitHash.autogenerated