From 64fe203a90056351a16035ef862862e076b21fd1 Mon Sep 17 00:00:00 2001 From: Jakob Harder <12190313+jakobharder@users.noreply.github.com> Date: Sun, 25 Feb 2024 17:24:03 +0100 Subject: [PATCH] work around git hash in version --- source/Burntime.MonoGame/get-file-version.bat | 2 +- source/Burntime.MonoGame/get-product-version.bat | 2 +- source/Burntime.MonoGame/get-semver-version.bat | 2 +- source/Burntime.Remaster/Application.cs | 4 ++++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/source/Burntime.MonoGame/get-file-version.bat b/source/Burntime.MonoGame/get-file-version.bat index d769332..b7c4a6a 100644 --- a/source/Burntime.MonoGame/get-file-version.bat +++ b/source/Burntime.MonoGame/get-file-version.bat @@ -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 diff --git a/source/Burntime.MonoGame/get-product-version.bat b/source/Burntime.MonoGame/get-product-version.bat index 08b56ea..32796ac 100644 --- a/source/Burntime.MonoGame/get-product-version.bat +++ b/source/Burntime.MonoGame/get-product-version.bat @@ -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 ) diff --git a/source/Burntime.MonoGame/get-semver-version.bat b/source/Burntime.MonoGame/get-semver-version.bat index ade71a4..9f61026 100644 --- a/source/Burntime.MonoGame/get-semver-version.bat +++ b/source/Burntime.MonoGame/get-semver-version.bat @@ -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 diff --git a/source/Burntime.Remaster/Application.cs b/source/Burntime.Remaster/Application.cs index 2c8f064..7e31896 100644 --- a/source/Burntime.Remaster/Application.cs +++ b/source/Burntime.Remaster/Application.cs @@ -7,6 +7,7 @@ using Burntime.Remaster; using static Burntime.Remaster.BurntimeClassic; using System.Diagnostics; +using System.Linq; namespace Burntime.Remaster { @@ -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; } }