Skip to content

Commit

Permalink
Update-ReleaseNotes
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Haynes committed Oct 10, 2018
1 parent 1477376 commit f9e6dc5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Tools/Release/Release.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -285,18 +285,17 @@ function Update-ReleaseNotes

Write-Host 'Updating ReleaseNotes'
$changelogPath = (Get-ChildItem -Path $PWD -Filter "CHANGELOG.md").FullName
$changelogPath = Get-Content -Path $changelogPath -Raw
$changelogContent = Get-Content -Path $changelogPath -Raw

$unreleasedHeaderRegEx = '###\sUnreleased'
$unreleasedHeaderReplace = New-Object System.Text.StringBuilder
$null = $unreleasedHeaderReplace.AppendLine('### Unreleased')
$null = $unreleasedHeaderReplace.AppendLine('')
$null = $unreleasedHeaderReplace.AppendLine("### $ModuleVersion")

$changelogPath = $changelogPath -replace $unreleasedHeaderRegEx,
$changelogContent = $changelogContent -replace '###\sUnreleased',
$unreleasedHeaderReplace.ToString().Trim()

Set-Content -Path $changelogPath -Value $changelogPath.Trim()
Set-Content -Path $changelogPath -Value $changelogContent.Trim()
}

<#
Expand Down

0 comments on commit f9e6dc5

Please sign in to comment.