Skip to content

Commit

Permalink
tools: Handle a patch version of 0 when detecting packages to release
Browse files Browse the repository at this point in the history
  • Loading branch information
jskeet committed Jul 3, 2024
1 parent 7743e85 commit 5f9fba0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Src/Tools/PackageChecker/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ Package Fetch(string projectFile)
string id = Path.GetFileNameWithoutExtension(projectFile);
var version = doc.Root.Element("PropertyGroup").Element("Version").Value;

// A version of x.y.z.0 is packaged as just x.y.z
var bits = version.Split('.');
if (bits.Length == 4 && bits[3] == "0")
{
version = string.Join(".", bits.Take(3));
}

var url = new Uri($"https://globalcdn.nuget.org/packages/{id.ToLowerInvariant()}.{version}.nupkg");
var request = new HttpRequestMessage
{
Expand Down

0 comments on commit 5f9fba0

Please sign in to comment.