Skip to content

Commit b93424c

Browse files
committed
Fix another bug in ReleaseTools
The typo we fixed in review actually broke it (because it was already misbehaving, but in a working way). Also stop exporting functions.
1 parent 67fad24 commit b93424c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tools/ReleaseTools.psm1

+4-4
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,12 @@ function Get-FirstChangelog {
125125
[string]$RepositoryName
126126
)
127127
$Changelog = Get-Content -Path "$PSScriptRoot/../../$RepositoryName/$ChangelogFile"
128+
# NOTE: The space after the header marker is important! Otherwise ### matches.
129+
$Header = $Changelog.Where({$_.StartsWith("## ")}, "First")
128130
$Changelog.Where(
129-
{ $_.StartsWith("##") }, "SkipUntil"
131+
{ $_ -eq $Header }, "SkipUntil"
130132
).Where(
131-
{ $_.StartsWith("##") }, "Until"
133+
{ $_.StartsWith("## ") -and $_ -ne $Header }, "Until"
132134
)
133135
}
134136

@@ -355,5 +357,3 @@ function New-DraftRelease {
355357
Get-GitHubRepository -OwnerName PowerShell -RepositoryName $RepositoryName |
356358
New-GitHubRelease @ReleaseParams
357359
}
358-
359-
Export-ModuleMember -Function Update-Changelog, Update-Version, New-DraftRelease

0 commit comments

Comments
 (0)