From 943016bc9fcdd47721bb3eb0e40b8bbf2359acbc Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Mon, 6 Dec 2021 19:42:12 -0600 Subject: add semantic version --- src/slskd/Program.cs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/slskd/Program.cs') diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs index e4257037..79c012bb 100644 --- a/src/slskd/Program.cs +++ b/src/slskd/Program.cs @@ -92,7 +92,12 @@ namespace slskd /// /// Gets the full application version, including both assembly and informational versions. /// - public static readonly string Version = $"{AssemblyVersion} ({InformationalVersion})"; + public static readonly string FullVersion = $"{AssemblyVersion} ({InformationalVersion})"; + + /// + /// Gets the semantic application version. + /// + public static readonly string SemanticVersion = InformationalVersion.Split('-').First(); /// /// Gets a value indicating whether the current version is a Canary build. @@ -172,7 +177,7 @@ namespace slskd if (ShowVersion) { - Console.WriteLine(Version); + Console.WriteLine(FullVersion); return; } @@ -180,7 +185,7 @@ namespace slskd { if (!NoLogo) { - PrintLogo(Version); + PrintLogo(FullVersion); } if (ShowHelp) @@ -249,7 +254,6 @@ namespace slskd .MinimumLevel.Override("Microsoft", LogEventLevel.Warning) .MinimumLevel.Override("System.Net.Http.HttpClient", OptionsAtStartup.Debug ? LogEventLevel.Warning : LogEventLevel.Fatal) .MinimumLevel.Override("slskd.Authentication.PassthroughAuthenticationHandler", LogEventLevel.Warning) - .Enrich.WithProperty("Version", Version) .Enrich.WithProperty("InstanceName", OptionsAtStartup.InstanceName) .Enrich.WithProperty("InvocationId", InvocationId) .Enrich.WithProperty("ProcessId", ProcessId) @@ -285,10 +289,10 @@ namespace slskd if (!OptionsAtStartup.NoLogo) { - PrintLogo(Version); + PrintLogo(FullVersion); } - logger.Information("Version: {Version}", Version); + logger.Information("Version: {Version}", FullVersion); if (IsCanary) { -- cgit v1.2.3