Skip to content

Commit 64fe203

Browse files
committed
work around git hash in version
1 parent af22534 commit 64fe203

4 files changed

Lines changed: 7 additions & 3 deletions

File tree

source/Burntime.MonoGame/get-file-version.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
:: v1.2.3-1-asdf -> 1.2.3.1
66
:: v1.2-1-asdf -> 1.2.0.1
77

8-
FOR /F "tokens=1 delims==v+" %%n IN ('git describe --tags --abbrev=0') DO (
8+
FOR /F "tokens=1 delims==v+" %%n IN ('git describe --tags') DO (
99
FOR /F "tokens=1-3 delims==-" %%i IN ("%%n") DO (
1010
IF "%%j%%k" == "" (
1111
echo %%i

source/Burntime.MonoGame/get-product-version.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
:: v1.2.3-rc1 -> 1.2.3-rc1
55
:: v1.2.3-1-asdf -> 1.2.3-1-asdf
66

7-
FOR /F "tokens=1-2 delims==v+" %%i IN ('git describe --tags --abbrev=0') DO (
7+
FOR /F "tokens=1-2 delims==v+" %%i IN ('git describe --tags') DO (
88
echo %%i
99
)

source/Burntime.MonoGame/get-semver-version.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
:: v1.2-1-asdf -> 1.2.0.1
77
:: v1.2.3-rc1+abc -> 1.2.3-rc1
88

9-
FOR /F "tokens=1 delims==v+" %%n IN ('git describe --tags --abbrev=0') DO (
9+
FOR /F "tokens=1 delims==v+" %%n IN ('git describe --tags') DO (
1010
FOR /F "tokens=1-3 delims==-" %%i IN ("%%n") DO (
1111
IF "%%j%%k" == "" (
1212
echo %%i

source/Burntime.Remaster/Application.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using Burntime.Remaster;
88
using static Burntime.Remaster.BurntimeClassic;
99
using System.Diagnostics;
10+
using System.Linq;
1011

1112
namespace Burntime.Remaster
1213
{
@@ -38,7 +39,10 @@ public static string Version
3839
get
3940
{
4041
if (_version is null)
42+
{
4143
_version = FileVersionInfo.GetVersionInfo(System.IO.Path.Combine(System.AppContext.BaseDirectory, "burntime.exe")).ProductVersion ?? "?";
44+
_version = _version.Split('+').First();
45+
}
4246
return _version;
4347
}
4448
}

0 commit comments

Comments
 (0)