Skip to content

Commit

Permalink
Fix SemVer.ToString to handle v0 case (#24101)
Browse files Browse the repository at this point in the history
Since we are treating v0 versions as prerelease we need to make sure
we don't accidently start to add the bogus prerelease label in cases where
we call ToString() on the version.

Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>
  • Loading branch information
azure-sdk and weshaggard authored Sep 13, 2021
1 parent 7285951 commit ec92967
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion eng/common/scripts/SemVer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class AzureEngSemanticVersion : IComparable {
{
$versionString = "{0}.{1}.{2}" -F $this.Major, $this.Minor, $this.Patch

if ($this.IsPrerelease)
if ($this.IsPrerelease -and $this.PrereleaseLabel -ne "zzz")
{
$versionString += $this.PrereleaseLabelSeparator + $this.PrereleaseLabel + `
$this.PrereleaseNumberSeparator + $this.PrereleaseNumber
Expand Down

0 comments on commit ec92967

Please sign in to comment.