aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd
diff options
context:
space:
mode:
authorJP Dillingham <jpdillingham@gmail.com>2021-12-06 19:42:12 -0600
committerJP Dillingham <jpdillingham@gmail.com>2021-12-06 19:42:12 -0600
commit943016bc9fcdd47721bb3eb0e40b8bbf2359acbc (patch)
treeb571427cd31439d1cb92b81b0455904e9fa32cef /src/slskd
parent93afab4aadd02688002bac34133f884bf5ffa067 (diff)
downloadslskd-943016bc9fcdd47721bb3eb0e40b8bbf2359acbc.tar.gz
add semantic version
Diffstat (limited to 'src/slskd')
-rw-r--r--src/slskd/Program.cs16
-rw-r--r--src/slskd/State.cs3
2 files changed, 12 insertions, 7 deletions
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
/// <summary>
/// Gets the full application version, including both assembly and informational versions.
/// </summary>
- public static readonly string Version = $"{AssemblyVersion} ({InformationalVersion})";
+ public static readonly string FullVersion = $"{AssemblyVersion} ({InformationalVersion})";
+
+ /// <summary>
+ /// Gets the semantic application version.
+ /// </summary>
+ public static readonly string SemanticVersion = InformationalVersion.Split('-').First();
/// <summary>
/// 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)
{
diff --git a/src/slskd/State.cs b/src/slskd/State.cs
index bff2dc5b..afe9b0b1 100644
--- a/src/slskd/State.cs
+++ b/src/slskd/State.cs
@@ -38,7 +38,8 @@ namespace slskd
public record VersionState
{
- public string Current { get; init; } = Program.InformationalVersion;
+ public string Full { get; init; } = Program.FullVersion;
+ public string Current { get; init; } = Program.SemanticVersion;
public string Latest { get; init; } = null;
public bool? IsUpdateAvailable { get; init; } = null;
public bool IsCanary { get; init; } = Program.IsCanary;