Skip to content

Commit

Permalink
Sync eng/common directory with azure-sdk-tools repository for Tools P…
Browse files Browse the repository at this point in the history
…R 955
  • Loading branch information
azure-sdk committed Sep 3, 2020
1 parent f5fbc85 commit c418d2c
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,
$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 c418d2c

Please sign in to comment.