Skip to content

Commit

Permalink
chore: Fix unstable version setting
Browse files Browse the repository at this point in the history
  • Loading branch information
twpol committed Jul 25, 2019
1 parent be7a3ec commit 7d9f14b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ IF "%Mode%" == "Stable" (
)

REM Get product version and code revision.
FOR /F "usebackq tokens=1* delims==" %%A IN (`CALL GetVersion.cmd`) DO SET %%A=%%B
FOR /F "usebackq tokens=1* delims==" %%A IN (`CALL GetVersion.cmd %Mode%`) DO SET %%A=%%B
SET Version=%OpenRails_Version%
SET Revision=%OpenRails_Revision%

Expand Down
4 changes: 1 addition & 3 deletions GetVersion.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
REM Get product version and code revision.
SET Version=
SET Revision=
FOR /F "usebackq tokens=2" %%B IN (`git branch --points-at HEAD`) DO SET Branch=%%B
FOR /F "usebackq tokens=1* delims=-" %%V IN (`git describe --first-parent --always --long`) DO (
SET Version=%%V
SET Revision=%%W
)
IF "%Branch%" == "unstable" (
IF "%~1%" == "Unstable" (
SET TZ=UTC
FOR /F "usebackq tokens=1* delims=-" %%V IN (`git log -1 --pretty^=format:^%%ad --date^=format-local:^%%Y^.%%m^.%%d-^%%H^%%M`) DO (
SET Version=%%V
Expand All @@ -21,6 +20,5 @@ IF "%Version%" == "" (
)

REM Output version numbers.
ECHO OpenRails_Branch=%Branch%
ECHO OpenRails_Version=%Version%
ECHO OpenRails_Revision=%Revision%

0 comments on commit 7d9f14b

Please sign in to comment.