From 3f80a0f0e54e5cfcab73a3e6d593f630fb7bcae6 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Mon, 13 Sep 2021 13:03:59 -0700 Subject: [PATCH] Fix SemVer.ToString to handle v0 case (#23962) 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