Skip to content

Commit

Permalink
FIxed invalid version number when version tag contains only 1 component.
Browse files Browse the repository at this point in the history
  • Loading branch information
kekyo committed Jun 26, 2023
1 parent 92e18d0 commit e4af1ea
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions CenterCLR.RelaxVersioner.Core/Version.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@ public Version(int major, int minor, int build, int revision)
private IEnumerable<int> GetComponents()
{
yield return this.Major;
if (this.Minor.HasValue)

// HACK: The version number format is valid on 2 or more components.
yield return this.Minor.HasValue ? this.Minor.Value : 0;

if (this.Build.HasValue)
{
yield return this.Minor.Value;
if (this.Build.HasValue)
yield return this.Build.Value;
if (this.Revision.HasValue)
{
yield return this.Build.Value;
if (this.Revision.HasValue)
{
yield return this.Revision.Value;
}
yield return this.Revision.Value;
}
}
}
Expand Down

0 comments on commit e4af1ea

Please sign in to comment.