diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Application.cs | 6 | ||||
| -rw-r--r-- | src/slskd/Program.cs | 15 | ||||
| -rw-r--r-- | src/slskd/State.cs | 1 |
3 files changed, 22 insertions, 0 deletions
diff --git a/src/slskd/Application.cs b/src/slskd/Application.cs index 856b898d..021a6c40 100644 --- a/src/slskd/Application.cs +++ b/src/slskd/Application.cs @@ -141,6 +141,12 @@ namespace slskd /// <returns>The operation context.</returns> public async Task CheckVersionAsync() { + if (Program.IsDevelopment) + { + Logger.Information("Skipping version check for Development build"); + return; + } + if (Program.IsCanary) { // todo: use the docker hub API to find the latest canary tag diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs index 5d81c5a5..b109c76b 100644 --- a/src/slskd/Program.cs +++ b/src/slskd/Program.cs @@ -114,6 +114,11 @@ namespace slskd public static bool IsCanary => AssemblyVersion.Revision == 65534; /// <summary> + /// Gets a value indicating whether the current version is a Development build. + /// </summary> + public static bool IsDevelopment => new Version(0, 0, 0, 0) == AssemblyVersion; + + /// <summary> /// Gets the path where application data is saved. /// </summary> [Argument(default, "app-dir", "path where application data is saved")] @@ -288,6 +293,11 @@ namespace slskd logger.Information("Version: {Version}", FullVersion); + if (IsDevelopment) + { + logger.Warning("This is a Development build; YMMV"); + } + if (IsCanary) { logger.Warning("This is a canary build"); @@ -556,6 +566,11 @@ namespace slskd │ │ │{centeredVersion}│"; + if (IsDevelopment) + { + banner += "\n│■■■■■■■■■■■■■■■■■■■■► DEVELOPMENT ◄■■■■■■■■■■■■■■■■■■■■■│"; + } + if (IsCanary) { banner += "\n│■■■■■■■■■■■■■■■■■■■■■■■► CANARY ◄■■■■■■■■■■■■■■■■■■■■■■■│"; diff --git a/src/slskd/State.cs b/src/slskd/State.cs index afe9b0b1..d07c603a 100644 --- a/src/slskd/State.cs +++ b/src/slskd/State.cs @@ -43,6 +43,7 @@ namespace slskd public string Latest { get; init; } = null; public bool? IsUpdateAvailable { get; init; } = null; public bool IsCanary { get; init; } = Program.IsCanary; + public bool IsDevelopment { get; init; } = Program.IsDevelopment; } public record ServerState |
