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]";
}
}

View File

@@ -219,6 +219,7 @@ public class CommandService : IDisposable
{
if (state != null)
{
//todo: still check and disable other profiles in this case?
if (targetProfile!.Enabled == state)
{
_chatService.PrintInChat(new SeStringBuilder()

View File

@@ -5,6 +5,7 @@ using CustomizePlus.Armatures.Services;
using CustomizePlus.Configuration.Data;
using CustomizePlus.Core.Data;
using CustomizePlus.Core.Extensions;
using CustomizePlus.Core.Helpers;
using CustomizePlus.Profiles;
using CustomizePlus.Templates;
using Dalamud.Plugin;
@@ -38,7 +39,7 @@ public class SupportLogBuilderService
{
var sb = new StringBuilder(102400); //it's fair to assume this will very often be quite large
sb.AppendLine("**Settings**");
sb.Append($"> **`Plugin Version: `** {Plugin.Version}\n");
sb.Append($"> **`Plugin Version: `** {VersionHelper.Version}\n");
sb.Append($"> **`Commit Hash: `** {ThisAssembly.Git.Commit}+{ThisAssembly.Git.Sha}\n");
sb.Append($"> **`Plugin enabled: `** {_configuration.PluginEnabled}\n");
sb.AppendLine("**Settings -> Editor Settings**");