-
Notifications
You must be signed in to change notification settings - Fork 205
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
Fail the process if exec
fails
#236
Conversation
@@ -339,7 +339,7 @@ def env_hash | |||
|
|||
def exec(cmd, method: :system) | |||
Dir.chdir root do | |||
Kernel.public_send(method, env_hash, cmd, err: :out) | |||
Kernel.public_send(method, env_hash, cmd, err: :out) or fail(cmd) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use ||
instead of or
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you might also be able to use Kernel.exit
here: https://github.com/thoughtbot/parity/blob/256f9a3f995d21fa6059efcd523855f2a1a0c381/bin/production#L8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@geoffharcourt yup, ended up using that here
9ba5b36
to
b8b8963
Compare
This slipped my mind before, but is there a way to test this by simulating the failure of a dependency build? |
@geoffharcourt do you mean in a test? |
Yeah. Unfortunately we didn't do it in Parity on the same type of change, so maybe that's overkill. |
5e6d461
to
dd68cd0
Compare
When running `install_dependencies` or `compile`, failures won't halt the host program. This could lead to false positives and difficult to debug scenarios. Consumers would prefer this to fail as early on as possible.
dd68cd0
to
afa84fa
Compare
When running
install_dependencies
orcompile
, failures won't haltthe host program.
This could lead to false positives and difficult to debug scenarios.
Consumers would prefer this to fail as early on as possible.