Skip to content

Commit

Permalink
Fix SemVer.ToString to handle v0 case (Azure#20665)
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 dd67039 commit 90ce516
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 90ce516

Please sign in to comment.