Skip to content

Commit

Permalink
work around git hash in version
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobharder committed Feb 25, 2024
1 parent af22534 commit 64fe203
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion source/Burntime.MonoGame/get-file-version.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
:: v1.2.3-1-asdf -> 1.2.3.1
:: v1.2-1-asdf -> 1.2.0.1

FOR /F "tokens=1 delims==v+" %%n IN ('git describe --tags --abbrev=0') DO (
FOR /F "tokens=1 delims==v+" %%n IN ('git describe --tags') DO (
FOR /F "tokens=1-3 delims==-" %%i IN ("%%n") DO (
IF "%%j%%k" == "" (
echo %%i
Expand Down
2 changes: 1 addition & 1 deletion source/Burntime.MonoGame/get-product-version.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
:: v1.2.3-rc1 -> 1.2.3-rc1
:: v1.2.3-1-asdf -> 1.2.3-1-asdf

FOR /F "tokens=1-2 delims==v+" %%i IN ('git describe --tags --abbrev=0') DO (
FOR /F "tokens=1-2 delims==v+" %%i IN ('git describe --tags') DO (
echo %%i
)
2 changes: 1 addition & 1 deletion source/Burntime.MonoGame/get-semver-version.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
:: v1.2-1-asdf -> 1.2.0.1
:: v1.2.3-rc1+abc -> 1.2.3-rc1

FOR /F "tokens=1 delims==v+" %%n IN ('git describe --tags --abbrev=0') DO (
FOR /F "tokens=1 delims==v+" %%n IN ('git describe --tags') DO (
FOR /F "tokens=1-3 delims==-" %%i IN ("%%n") DO (
IF "%%j%%k" == "" (
echo %%i
Expand Down
4 changes: 4 additions & 0 deletions source/Burntime.Remaster/Application.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Burntime.Remaster;
using static Burntime.Remaster.BurntimeClassic;
using System.Diagnostics;
using System.Linq;

namespace Burntime.Remaster
{
Expand Down Expand Up @@ -38,7 +39,10 @@ public static string Version
get
{
if (_version is null)
{
_version = FileVersionInfo.GetVersionInfo(System.IO.Path.Combine(System.AppContext.BaseDirectory, "burntime.exe")).ProductVersion ?? "?";
_version = _version.Split('+').First();
}
return _version;
}
}
Expand Down

0 comments on commit 64fe203

Please sign in to comment.