Skip to content

Commit

Permalink
Remove git commit hash from CLI banner when published in release mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ScrubN committed Feb 11, 2024
1 parent 765d800 commit b03fc6f
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 @@ -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)")}");
}
}
}

0 comments on commit b03fc6f

Please sign in to comment.