From a257e50efc5067ce994f73986f53eb7e46724b1b Mon Sep 17 00:00:00 2001 From: Luca Auer Date: Fri, 28 Feb 2020 16:13:27 +0100 Subject: [PATCH] Decrease build number to work against increment behavior in gitversion that can't be turned off --- ImageSort.WindowsUpdater/GitHubUpdateFetcher.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ImageSort.WindowsUpdater/GitHubUpdateFetcher.cs b/ImageSort.WindowsUpdater/GitHubUpdateFetcher.cs index 408b93ba..5bf572b7 100644 --- a/ImageSort.WindowsUpdater/GitHubUpdateFetcher.cs +++ b/ImageSort.WindowsUpdater/GitHubUpdateFetcher.cs @@ -2,6 +2,7 @@ using Semver; using System; using System.Collections.Generic; +using System.Globalization; using System.IO; using System.Linq; using System.Net.Http; @@ -42,6 +43,8 @@ public GitHubUpdateFetcher(GitHubClient client) var releaseVersion = SemVersion.Parse(release.TagName.Substring(firstIndexOfV + 1)); + if (int.TryParse(releaseVersion.Build, out int build)) releaseVersion = releaseVersion.Change(build: (build - 1).ToString(CultureInfo.InvariantCulture.NumberFormat)); + var isNewVersion = version.CompareTo(releaseVersion) < 0; return prereleaseCondition && isNewVersion;