Testing version warning

This commit is contained in:
RisaDev
2024-10-24 23:38:39 +03:00
parent 4284b323ef
commit a3c3d4d0e5
6 changed files with 43 additions and 12 deletions

View File

@@ -0,0 +1,27 @@
#if !DEBUG
using System.Reflection;
#endif
namespace CustomizePlus.Core.Helpers;
internal static class VersionHelper
{
public static string Version { get; private set; } = "Initializing";
public static bool IsTesting { get; private set; } = false;
static VersionHelper()
{
#if DEBUG
Version = $"{ThisAssembly.Git.Commit}+{ThisAssembly.Git.Sha} [DEBUG]";
#else
Version = Assembly.GetExecutingAssembly().GetName().Version?.ToString() ?? string.Empty;
#endif
if (ThisAssembly.Git.BaseTag.ToLowerInvariant().Contains("testing"))
IsTesting = true;
if (IsTesting)
Version += " [TESTING BUILD]";
}
}