Skip to content

Commit

Permalink
Allow updating the release date (#955)
Browse files Browse the repository at this point in the history
  • Loading branch information
pakrym authored Sep 4, 2020
1 parent 1171353 commit 6e6a2f8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions eng/common/Update-Change-Log.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ param (
[Parameter(Mandatory = $true)]
[String]$ChangeLogPath,
[String]$Unreleased = $True,
[String]$ReplaceVersion = $False
[String]$ReplaceVersion = $False,
[String]$ReleaseDate
)


Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 6e6a2f8

Please sign in to comment.