Fix SemVer.ToString to handle v0 case (#2863)

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>
This commit is contained in:
Azure SDK Bot 2021-09-13 13:06:08 -07:00 committed by GitHub
parent 4aacb5f59f
commit 34cb6c76ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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