From b03fc6f943f96cf865f1f017a8ea94bc39a4b21f Mon Sep 17 00:00:00 2001 From: ScrubN <72096833+ScrubN@users.noreply.github.com> Date: Sun, 11 Feb 2024 17:49:38 -0500 Subject: [PATCH] Remove git commit hash from CLI banner when published in release mode --- TwitchDownloaderCLI/Program.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/TwitchDownloaderCLI/Program.cs b/TwitchDownloaderCLI/Program.cs index f6e4aabe..23121d65 100644 --- a/TwitchDownloaderCLI/Program.cs +++ b/TwitchDownloaderCLI/Program.cs @@ -79,7 +79,14 @@ private static void WriteApplicationBanner(ITwitchDownloaderArgs args, string[] return; } - Console.WriteLine($"{HeadingInfo.Default} {CopyrightInfo.Default.ToString()!.Replace("\u00A9", "(c)")}"); + var nameVersionString = HeadingInfo.Default.ToString(); + +#if !DEBUG + // Remove git commit hash from version string + nameVersionString = System.Text.RegularExpressions.Regex.Replace(nameVersionString, @"(?<=\d)\+[0-9a-f]+", ""); +#endif + + Console.WriteLine($"{nameVersionString} {CopyrightInfo.Default.ToString()!.Replace("\u00A9", "(c)")}"); } } } \ No newline at end of file