Skip to content

Commit

Permalink
Merge pull request #21 from unoplatform/dev/jela/empty-version
Browse files Browse the repository at this point in the history
fix: Don't require a version when using upgrade policy
  • Loading branch information
jeromelaban authored Nov 4, 2024
2 parents 9a177f3 + b9077cb commit a72e85b
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 a72e85b

Please sign in to comment.