Skip to content

Commit

Permalink
fix: Don't require a version when using upgrade policy
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban committed Nov 4, 2024
1 parent 7b4c8b4 commit b9077cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/NvGet.Tools.Shared/Arguments/ConsoleArgsContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Action<string> TryParseAndSet<T>(Func<string, T> parse, Action<T> set)
includeMaxVersion: true,
floatRange: null,
originalString: null)) :
(false, r.UpgradePolicy, VersionRange.Parse(r.UpdatedVersion)));
(false, r.UpgradePolicy, VersionRange.Parse(r.UpdatedVersion ?? "0.0.0.0")));

async Task<IEnumerable<UpdateResult>> LoadFromStreamAsync()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ UpgradePolicy upgradePolicy
{
return true;
}
else if(upgradePolicy == UpgradePolicy.Minor)
else if (upgradePolicy == UpgradePolicy.Minor)
{
return version.Version < new Version(reference.Identity.Version.Major + 1, 0, 0);
}
else if(upgradePolicy == UpgradePolicy.Patch)
else if (upgradePolicy == UpgradePolicy.Patch)
{
return version.Version < new Version(reference.Identity.Version.Major, reference.Identity.Version.Minor + 1, 0);
}
Expand Down

0 comments on commit b9077cb

Please sign in to comment.