Disallow version bump with dirty working tree

This commit is contained in:
Trent Nelson 2021-03-15 12:52:57 -06:00 committed by mergify[bot]
parent c1ba265dd9
commit 853e735edf
1 changed files with 11 additions and 0 deletions

View File

@ -105,6 +105,17 @@ check)
;;
esac
# Version bumps should occur in their own commit. Disallow bumping version
# in dirty working trees. Gate after arg parsing to prevent breaking the
# `check` subcommand.
(
set +e
if ! git diff --exit-code; then
echo -e "\nError: Working tree is dirty. Commit or discard changes before bumping version." 1>&2
exit 1
fi
)
newVersion="$MAJOR.$MINOR.$PATCH$SPECIAL"
# Update all the Cargo.toml files