diff --git a/.unreleased/RELEASE_NOTES_HEADER.md.j2 b/scripts/changelog/RELEASE_NOTES_HEADER.md.j2 similarity index 100% rename from .unreleased/RELEASE_NOTES_HEADER.md.j2 rename to scripts/changelog/RELEASE_NOTES_HEADER.md.j2 diff --git a/.unreleased/template.release_notes_header.j2 b/scripts/changelog/template.release_notes_header.j2 similarity index 100% rename from .unreleased/template.release_notes_header.j2 rename to scripts/changelog/template.release_notes_header.j2 diff --git a/.unreleased/template.rfc822 b/scripts/changelog/template.rfc822 similarity index 100% rename from .unreleased/template.rfc822 rename to scripts/changelog/template.rfc822 diff --git a/scripts/merge_changelogs.sh b/scripts/merge_changelogs.sh index 7d1ca1f2c89..11e81685d43 100755 --- a/scripts/merge_changelogs.sh +++ b/scripts/merge_changelogs.sh @@ -1,17 +1,17 @@ #!/usr/bin/env bash +set -eu # # This script build a CHANGELOG.md entry for a new release # -RELEASE_NOTES_HEADER_TEMPLATE='.unreleased/RELEASE_NOTES_HEADER.md.j2' +REPO="$(readlink -e "$(dirname "${BASH_SOURCE[0]}")/..")" +RELEASE_NOTES_HEADER_TEMPLATE="$REPO/scripts/changelog/RELEASE_NOTES_HEADER.md.j2" echo_changelog() { echo "${1}" # skip the template and release notes files grep -i "${2}" .unreleased/* | \ - grep -v '.unreleased/template.*' | \ - grep -v "${RELEASE_NOTES_HEADER_TEMPLATE}" | \ cut -d: -f3- | sort | uniq | sed -e 's/^[[:space:]]*//' -e 's/^/* /' echo } @@ -33,7 +33,7 @@ then jinja \ -D release_current "${RELEASE_CURRENT}" \ -D release_previous "${RELEASE_PREVIOUS}" \ - -D release_date "${RELEASE_DATE}" ${RELEASE_NOTES_HEADER_TEMPLATE} + -D release_date "${RELEASE_DATE}" "${RELEASE_NOTES_HEADER_TEMPLATE}" echo fi