chore(devenv): Add error checks to release script

This commit is contained in:
Evan Fiordeliso 2024-03-08 13:57:03 -05:00
parent 9fa89556d5
commit f19de5ce42
2 changed files with 13 additions and 0 deletions

View File

@ -2,6 +2,12 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
## [1.2.2] - 2024-03-08
### ⚙️ Miscellaneous Tasks
- Re-generate changelog
## [1.2.1] - 2024-03-08 ## [1.2.1] - 2024-03-08
### 🐛 Bug Fixes ### 🐛 Bug Fixes

View File

@ -27,6 +27,13 @@
gen-changelog.exec = "git cliff -o $CHANGELOG_FILE"; gen-changelog.exec = "git cliff -o $CHANGELOG_FILE";
release.exec = '' release.exec = ''
set -euo pipefail
if [ -n "$(git status --porcelain)" ]; then
printf "Working directory is not clean. Please commit or stash your changes.\n"
exit 1
fi
version="$(git cliff --bumped-version)" version="$(git cliff --bumped-version)"
git cliff --bump --unreleased --prepend $CHANGELOG_FILE git cliff --bump --unreleased --prepend $CHANGELOG_FILE
git add $CHANGELOG_FILE git add $CHANGELOG_FILE