diff --git a/scripts/release.ps1 b/scripts/release.ps1 index df80f57..4c99e74 100644 --- a/scripts/release.ps1 +++ b/scripts/release.ps1 @@ -128,15 +128,16 @@ function Set-ProjectVersion([string]$New) { function Undo-VersionChange { if ($script:Bumped -and -not $script:Committed) { Write-Info 'Versionsänderung wird zurückgenommen ...' - & git checkout -- @VersionFiles 2>$null | Out-Null + & git checkout -- @VersionFiles | Out-Null $script:Bumped = $false } } function Get-ReleaseNotes([string]$NewVersion) { $lastTag = $null - $found = & git describe --tags --abbrev=0 --match 'v*' 2>$null - if ($LASTEXITCODE -eq 0 -and $found) { $lastTag = [string]$found } + $tags = & git tag --list 'v*' --sort=-version:refname + if ($LASTEXITCODE -ne 0) { throw 'git tag ist fehlgeschlagen.' } + if ($tags) { $lastTag = [string]($tags | Select-Object -First 1) } $range = 'HEAD' if ($lastTag) { $range = "$lastTag..HEAD" } $lines = & git -c core.quotepath=off log $range --no-merges --pretty=format:'- %s (%h)' --grep='^Release v' --invert-grep