From ec92967fd70f891fee12498a5b131a300e00f90c 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:52 -0700 Subject: [PATCH] Fix SemVer.ToString to handle v0 case (#24101) 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 b3ca5353274d5..6459f252a67c6 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