From 90ce5164a256f911e9ee1bf7a0cf88d828807fb9 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Mon, 13 Sep 2021 13:06:02 -0700 Subject: [PATCH] Fix SemVer.ToString to handle v0 case (#20665) 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 --- eng/common/scripts/SemVer.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/scripts/SemVer.ps1 b/eng/common/scripts/SemVer.ps1 index b3ca5353274d..6459f252a67c 100644 --- a/eng/common/scripts/SemVer.ps1 +++ b/eng/common/scripts/SemVer.ps1 @@ -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