From d35cd75ad7bf10e219aaf656f60155c83fa5567e Mon Sep 17 00:00:00 2001 From: Nick Barrett Date: Wed, 29 Jan 2020 18:25:10 +0000 Subject: [PATCH] Release tweaks. --- scripts/clean.sh | 2 ++ scripts/release.py | 12 +++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/scripts/clean.sh b/scripts/clean.sh index 053316b4..969a6b14 100755 --- a/scripts/clean.sh +++ b/scripts/clean.sh @@ -4,6 +4,8 @@ set -ex echo "--> nuking dist/ & build/" rm -rf dist/* +rm -f dist/.release_version_lock +rm -f dist/.spec rm -rf build/* echo "--> nuking anything in pyu-data/new" diff --git a/scripts/release.py b/scripts/release.py index 2af3b822..6dfeda41 100755 --- a/scripts/release.py +++ b/scripts/release.py @@ -104,15 +104,17 @@ def _get_git_changes(): def _update_changelog(version, git_changes): - # Edit/create the changelog - with open('CHANGELOG.md', 'r') as f: - changelog_data = f.read() + new_changelog = f'# v{version}\n\nChanges:\n{git_changes}\n\n' + new_changelog = click.edit(new_changelog) - changelog_data = f'# v{version}\n\nChanges:\n{git_changes}\n\n{changelog_data}' - new_changelog = click.edit(changelog_data) if not new_changelog: raise click.BadParameter('Invalid changelog!') + with open('CHANGELOG.md', 'r') as f: + current_changelog = f.read() + + new_changelog = f'{new_changelog}{current_changelog}' + with open('CHANGELOG.md', 'w') as f: f.write(new_changelog)