Skip to content

Commit

Permalink
exit early on errors
Browse files Browse the repository at this point in the history
  • Loading branch information
eeeebbbbrrrr committed Nov 2, 2024
1 parent d0e0d18 commit 822dde9
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions prepare-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ if [ -z "${BASE_BRANCH}" ]; then
BASE_BRANCH=develop
fi

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

cargo install --path cargo-pgrx --locked
cargo pgrx init
cargo install --path cargo-pgrx --locked || exit $?
cargo pgrx init || exit $?

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

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

0 comments on commit 822dde9

Please sign in to comment.