From f19de5ce420b85743b7d7fd82b829ccfacc94538 Mon Sep 17 00:00:00 2001 From: Evan Fiordeliso Date: Fri, 8 Mar 2024 13:57:03 -0500 Subject: [PATCH] chore(devenv): Add error checks to release script --- CHANGELOG.md | 6 ++++++ devenv.nix | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 381ab95..c7fe4cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ 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 ### 🐛 Bug Fixes diff --git a/devenv.nix b/devenv.nix index 87e7f59..06fe3a4 100644 --- a/devenv.nix +++ b/devenv.nix @@ -27,6 +27,13 @@ gen-changelog.exec = "git cliff -o $CHANGELOG_FILE"; 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)" git cliff --bump --unreleased --prepend $CHANGELOG_FILE git add $CHANGELOG_FILE