We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 674db12 commit 42bdab3Copy full SHA for 42bdab3
1 file changed
src/WGet.NET/Components/WinGetPackageManager.cs
@@ -808,12 +808,12 @@ public async Task<bool> UpgradeAllPackagesAsync()
808
809
private string AddArgumentByVersion(string argument)
810
{
811
- // Checking version to determine if "--include-unknown" is necessary
812
- bool castSuccessful = int.TryParse(WinGetVersion.Split(".")[1], out int wingetMinorVersion);
813
- if (castSuccessful && wingetMinorVersion >= 4)
+ // Checking version to determine if "--include-unknown" is necessary.
+ Version winGetVersion = WinGetVersionObject;
+ if (winGetVersion.Major >= 1 && winGetVersion.Minor >= 4)
814
815
// Winget version supports new argument, add "--include-unknown" to arguments
816
- argument += " " + _includeUnknown;
+ argument += $" {_includeUnknown}";
817
}
818
return argument;
819
0 commit comments