From 56a187576c62839430cbefe4e5ad5a1511bb91ba Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Thu, 3 Sep 2020 13:25:11 -0700 Subject: [PATCH 1/4] Allow updating the release date --- eng/common/Update-Change-Log.ps1 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/eng/common/Update-Change-Log.ps1 b/eng/common/Update-Change-Log.ps1 index 6380e3ff800..92e6315b77f 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, + $ReleaseDate ) @@ -46,8 +47,8 @@ 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 ?? (Get-Date -Format "(yyyy-MM-dd)"); + $newVersionTitle = "## $Version $actualReleaseDate" } return $newVersionTitle } @@ -95,7 +96,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) } From adad04d0bc620b635a819cb4d5d11a98df791e72 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Thu, 3 Sep 2020 13:39:49 -0700 Subject: [PATCH 2/4] Parens --- eng/common/Update-Change-Log.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/common/Update-Change-Log.ps1 b/eng/common/Update-Change-Log.ps1 index 92e6315b77f..eb658c03ec9 100644 --- a/eng/common/Update-Change-Log.ps1 +++ b/eng/common/Update-Change-Log.ps1 @@ -47,8 +47,8 @@ function Get-VersionTitle($Version, $Unreleased) # Generate version title $newVersionTitle = "## $Version $UNRELEASED_TAG" if ($Unreleased -eq $False) { - $actualReleaseDate = $ReleaseDate ?? (Get-Date -Format "(yyyy-MM-dd)"); - $newVersionTitle = "## $Version $actualReleaseDate" + $actualReleaseDate = $ReleaseDate ?? (Get-Date -Format "yyyy-MM-dd"); + $newVersionTitle = "## $Version ($actualReleaseDate)" } return $newVersionTitle } From 9e22e096b87d72393ec0d9adee314517bd788206 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Thu, 3 Sep 2020 15:29:24 -0700 Subject: [PATCH 3/4] FB --- eng/common/Update-Change-Log.ps1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/eng/common/Update-Change-Log.ps1 b/eng/common/Update-Change-Log.ps1 index eb658c03ec9..66f6c38916d 100644 --- a/eng/common/Update-Change-Log.ps1 +++ b/eng/common/Update-Change-Log.ps1 @@ -47,7 +47,11 @@ function Get-VersionTitle($Version, $Unreleased) # Generate version title $newVersionTitle = "## $Version $UNRELEASED_TAG" if ($Unreleased -eq $False) { - $actualReleaseDate = $ReleaseDate ?? (Get-Date -Format "yyyy-MM-dd"); + $actualReleaseDate = $ReleaseDate; + + if (!$actualReleaseDate) { + $actualReleaseDate = Get-Date -Format "yyyy-MM-dd" + } $newVersionTitle = "## $Version ($actualReleaseDate)" } return $newVersionTitle From 46df186292fcf85427db0f873b55420da48fa1d2 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Thu, 3 Sep 2020 16:06:12 -0700 Subject: [PATCH 4/4] Update Update-Change-Log.ps1 --- eng/common/Update-Change-Log.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/Update-Change-Log.ps1 b/eng/common/Update-Change-Log.ps1 index 66f6c38916d..3d1497f2986 100644 --- a/eng/common/Update-Change-Log.ps1 +++ b/eng/common/Update-Change-Log.ps1 @@ -13,7 +13,7 @@ param ( [String]$ChangeLogPath, [String]$Unreleased = $True, [String]$ReplaceVersion = $False, - $ReleaseDate + [String]$ReleaseDate )