From 4e1a8b4adc1bf20c00de43d171586fd63d974050 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Fri, 4 Sep 2020 21:00:01 +0000 Subject: [PATCH] Sync eng/common directory with azure-sdk-tools repository --- eng/common/Update-Change-Log.ps1 | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/eng/common/Update-Change-Log.ps1 b/eng/common/Update-Change-Log.ps1 index 6380e3ff800a2..3d1497f298639 100644 --- a/eng/common/Update-Change-Log.ps1 +++ b/eng/common/Update-Change-Log.ps1 @@ -12,7 +12,8 @@ param ( [Parameter(Mandatory = $true)] [String]$ChangeLogPath, [String]$Unreleased = $True, - [String]$ReplaceVersion = $False + [String]$ReplaceVersion = $False, + [String]$ReleaseDate ) @@ -46,8 +47,12 @@ function Get-VersionTitle($Version, $Unreleased) # Generate version title $newVersionTitle = "## $Version $UNRELEASED_TAG" if ($Unreleased -eq $False) { - $releaseDate = Get-Date -Format "(yyyy-MM-dd)" - $newVersionTitle = "## $Version $releaseDate" + $actualReleaseDate = $ReleaseDate; + + if (!$actualReleaseDate) { + $actualReleaseDate = Get-Date -Format "yyyy-MM-dd" + } + $newVersionTitle = "## $Version ($actualReleaseDate)" } return $newVersionTitle } @@ -95,7 +100,7 @@ function Get-NewChangeLog( [System.Collections.ArrayList]$ChangelogLines, $Versi exit(0) } - if (($ReplaceVersion -eq $True) -and ($Unreleased -eq $False) -and $CurrentTitle.Contains($version) -and (-not $CurrentTitle.Contains($UNRELEASED_TAG))) { + if (($ReplaceVersion -eq $True) -and ($Unreleased -eq $False) -and $CurrentTitle.Contains($version) -and (-not $CurrentTitle.Contains($UNRELEASED_TAG)) -and (-not $ReleaseDate)) { Write-Host "Version is already present in change log with a release date." exit(0) }