Skip to content

Commit

Permalink
tag_release: check for uncommitted changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tmfink committed Feb 25, 2024
1 parent 637dde6 commit f62c58a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scripts/tag_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,17 @@ set -eu

cd "$(dirname $0)/.."

Error() {
echo "Error:" "$@" >&2
exit 1
}

extract_toml_value() {
grep "^$1" Cargo.toml | sed 's/^[^ =].*=.*"\([^"]\+\)"$/\1/' | head -n1
}

git diff --exit-code HEAD || Error "Uncommitted changes"

PACKAGE_NAME="$(extract_toml_value name)"
PACKAGE_VERSION="${PACKAGE_VERSION:-$(extract_toml_value version)}"
DESCRIPTION="${PACKAGE_NAME} v${PACKAGE_VERSION}"
Expand Down

0 comments on commit f62c58a

Please sign in to comment.