Skip to content

Commit

Permalink
Merge pull request #24 from lay295/master
Browse files Browse the repository at this point in the history
Remove git commit hash from CLI banner when published in release mode
  • Loading branch information
superbonaci authored Feb 13, 2024
2 parents a11aa5b + b03fc6f commit 719e3e4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion TwitchDownloaderCLI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,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)")}");
}
}
}

0 comments on commit 719e3e4

Please sign in to comment.