diff --git a/release.sh b/release.sh index d48907fc4..599ff35a0 100755 --- a/release.sh +++ b/release.sh @@ -154,8 +154,9 @@ if [ $dodist -eq 0 ]; then # it's building DIST_VERSION="$tag" npm run dist - `dirname $0`/scripts/changelog_head.py > latest_changes.md popd + + cat "${builddir}/CHANGELOG.md" | `dirname $0`/scripts/changelog_head.py > "${builddir}/latest_changes.md" for i in "$builddir"/dist/*; do assets="$assets -a $i" if [ -n "$signing_id" ] diff --git a/scripts/changelog_head.py b/scripts/changelog_head.py index 0c2a6bb17..c7c1c0aea 100755 --- a/scripts/changelog_head.py +++ b/scripts/changelog_head.py @@ -1,13 +1,14 @@ #!/usr/bin/env python """ -Outputs the body of the first entry of changelog file CHANGELOG.md +Outputs the body of the first entry of changelog file on stdin """ import re +import sys found_first_header = False -for line in open("CHANGELOG.md"): +for line in sys.stdin: line = line.strip() if re.match(r"^Changes in \[.*\]", line): if found_first_header: