diff --git a/scripts/publish_release.sh b/scripts/publish_release.sh index ab1e3e1..d3660d4 100755 --- a/scripts/publish_release.sh +++ b/scripts/publish_release.sh @@ -33,10 +33,15 @@ extract_changelog() { fi awk -v ver="## $version" ' - /^## [0-9]/ { if (found) exit; if ($0 ~ ver) found=1; next } - found && /^## / { exit } + /^## / { + if (found) exit + if ($0 ~ ver) { + found=1 + next + } + } found { print } - ' "$changelog_file" | sed '1d;$d' | sed -e 's/^[[:space:]]*$//' | sed -e :a -e '/^\s*$/d;N;ba' + ' "$changelog_file" } CHANGELOG_BODY="$(extract_changelog "$VERSION" "$CHANGELOG_FILE")"