Skip to content

Commit

Permalink
trim info version to be exactly what we want instead of including the…
Browse files Browse the repository at this point in the history
… full commit hash
  • Loading branch information
hahn-kev committed Dec 12, 2024
1 parent 71f6180 commit 9e0d4a5
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions backend/FwLite/FwLiteDesktop/AppVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ namespace FwLiteDesktop;

public class AppVersion
{
public static readonly string Version = typeof(AppVersion).Assembly
.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion ?? "dev";
static AppVersion()
{
var infoVersion = typeof(AppVersion).Assembly
.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion;
//info version may look like v2024-12-12-3073dd1c+3073dd1ce2ff5510f54a9411366f55c958b9ea45. We want to strip off everything after the +, so we can compare versions
if (infoVersion is not null && infoVersion.Contains('+'))
{
infoVersion = infoVersion[..infoVersion.IndexOf('+')];
}
Version = infoVersion ?? "dev";
}

public static readonly string Version;
}

0 comments on commit 9e0d4a5

Please sign in to comment.