Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exit if pre-up hook exits non-zero #289

Merged
merged 1 commit into from
Dec 30, 2022

Conversation

pbrisbin
Copy link
Contributor

No description provided.

Copy link
Contributor

@mike-burns mike-burns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, actually. Thanks for catching this.


if [ "$hook_ret" -ne 0 ]; then
echo "$when-$direction hook exited non-zero ($hook_ret)" >&2
exit $hook_ret # NB. this only exits the while-read; caller must still check and exit
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoa, that's good to know. Normally I don't love code comments but I definitely would have missed that quirk.

@pbrisbin pbrisbin marked this pull request as ready for review December 29, 2022 17:08
@pbrisbin pbrisbin requested a review from mike-burns December 29, 2022 17:08
@pbrisbin
Copy link
Contributor Author

Sweet. Thanks for the quick review! Should be good to merge now.

Copy link
Contributor

@mike-burns mike-burns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. I can merge it Friday, and see if I can get a release out this year. 'Tis the season!

This allows scripts to bail early if a check fails.
@mike-burns mike-burns merged commit 453e88b into thoughtbot:main Dec 30, 2022
@mike-burns
Copy link
Contributor

Thanks. Also adding one for the down case.

@pbrisbin pbrisbin deleted the pb/pre-up-failure branch December 30, 2022 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants