Skip to content

Commit 822dde9

Browse files
committed
exit early on errors
1 parent d0e0d18 commit 822dde9

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

prepare-release.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@ if [ -z "${BASE_BRANCH}" ]; then
2121
BASE_BRANCH=develop
2222
fi
2323

24-
git switch ${BASE_BRANCH}
25-
git fetch origin
24+
git switch ${BASE_BRANCH} || exit $?
25+
git fetch origin || exit $?
2626
git diff origin/${BASE_BRANCH} | if [ "$0" = "" ]; then
2727
echo "git diff found local changes on ${BASE_BRANCH} branch, cannot cut release."
2828
elif [ "$NEW_VERSION" = "" ]; then
2929
echo "No version set. Are you just copying and pasting this without checking?"
3030
else
31-
git pull origin ${BASE_BRANCH} --ff-only
32-
git switch -c "prepare-${NEW_VERSION}"
31+
git pull origin ${BASE_BRANCH} --ff-only || exit $?
32+
git switch -c "prepare-${NEW_VERSION}" || exit $?
3333

34-
cargo install --path cargo-pgrx --locked
35-
cargo pgrx init
34+
cargo install --path cargo-pgrx --locked || exit $?
35+
cargo pgrx init || exit $?
3636

3737
# exit early if the script fails
3838
./update-versions.sh "${NEW_VERSION}" || exit $?
@@ -41,7 +41,7 @@ else
4141
# git diff -- . ':(exclude)Cargo.lock'
4242

4343
# send it all to github
44-
git commit -a -m "Update version to ${NEW_VERSION}"
45-
git push --set-upstream origin "prepare-${NEW_VERSION}"
44+
git commit -a -m "Update version to ${NEW_VERSION}" || exit $?
45+
git push --set-upstream origin "prepare-${NEW_VERSION}" || exit $?
4646
fi
4747

0 commit comments

Comments
 (0)