Skip to content

Commit

Permalink
Make prepare release help check the changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
raksooo committed Jan 31, 2025
1 parent c000717 commit 9a2072c
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions desktop/scripts/prepare-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,28 @@ function checks {
fi
}

function check_changelog {
previous_version=$(grep -oP '## \[\K[^\]]+' $changelog_path | head -2 | tail -1)

log_header "Changelog since previous release"
git --no-pager diff -U10 "$previous_version"..HEAD -- $changelog_path

read -r -n 1 -p "Does this look good? (y: yes, q: abort, r: reload): " response
echo ""

if [[ "$response" =~ ^[Yy]$ ]]; then
return
elif [[ "$response" =~ ^[Qq]$ ]]; then
log_info "Aborting"
exit 1
elif [[ "$response" =~ ^[Rr]$ ]]; then
check_changelog
else
log_error "Invalid response"
check_changelog
fi
}

function update_changelog {
sed -i -e "/^## \[Unreleased\]/a \\\n\\n## \[$PRODUCT_VERSION\] - $(date +%F)" $changelog_path

Expand All @@ -80,6 +102,7 @@ function create_tag {
}

checks
check_changelog
update_changelog
update_product_version
create_tag
Expand Down

0 comments on commit 9a2072c

Please sign in to comment.