Skip to content

Commit 3d13d60

Browse files
committed
Fixed upgrade checking.
1 parent 5fd2eac commit 3d13d60

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## April 2022 Release (version 1.1.0)
1+
## April 2022 Release (version 1.1.2)
22

33
### Features
44

Visual Studio Solution Secrets/Program.cs

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,22 @@ __ ___ _ ____ _ _ _
108108

109109
static async Task CheckForUpdates()
110110
{
111-
var lastVersion = await Versions.CheckForNewVersion();
112-
if (lastVersion > _currentVersion)
111+
if (_currentVersion != null)
113112
{
114-
ShowLogo();
115-
Console.WriteLine($"Current version: {_currentVersion}\n");
116-
Console.WriteLine($">>> New version available: {lastVersion} <<<");
117-
Console.WriteLine("Use the command below for upgrading to the latest version:\n");
118-
Console.WriteLine(" dotnet tool update vs-secrets --global\n");
119-
Console.WriteLine("------------------------------------------------------------");
113+
var lastVersion = await Versions.CheckForNewVersion();
114+
115+
var v1 = new Version(lastVersion.Major, lastVersion.Minor, lastVersion.Build);
116+
var v2 = new Version(_currentVersion.Major, _currentVersion.Minor, _currentVersion.Build);
117+
118+
if (v1 > v2)
119+
{
120+
ShowLogo();
121+
Console.WriteLine($"Current version: {_currentVersion}\n");
122+
Console.WriteLine($">>> New version available: {lastVersion} <<<");
123+
Console.WriteLine("Use the command below for upgrading to the latest version:\n");
124+
Console.WriteLine(" dotnet tool update vs-secrets --global\n");
125+
Console.WriteLine("------------------------------------------------------------");
126+
}
120127
}
121128
}
122129

Visual Studio Solution Secrets/Visual Studio Solution Secrets.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<PackageReadmeFile>README.md</PackageReadmeFile>
2424
<PackageIcon>Icon.png</PackageIcon>
2525
<PackageProjectUrl>https://github.com/ernstc/VisualStudioSolutionSecrets</PackageProjectUrl>
26-
<Version>1.1.0</Version>
26+
<Version>1.1.2</Version>
2727
</PropertyGroup>
2828

2929
<ItemGroup>

0 commit comments

Comments
 (0)