-
Notifications
You must be signed in to change notification settings - Fork 90
Exiting PDF install script with error code if commands fail #1148
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
base: main
Are you sure you want to change the base?
Conversation
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.
/lgtm
jupyter/utils/install_pdf_deps.sh
Outdated
@@ -2,6 +2,8 @@ | |||
|
|||
# Install dependencies required for Notebooks PDF exports | |||
|
|||
set -e |
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.
Yep, that's how this is normally done
https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/
There are some piped commands below, so also consider
set -o pipefail
The bash shell normally only looks at the exit code of the last command of a pipeline. This behavior is not ideal as it causes the -e option to only be able to act on the exit code of a pipeline’s last command. This is where
-o pipefail
comes in.
For better build log, I also suggest set -x
/lgtm |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jiridanek The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Description
This forces the script to exit with error if some of the commands fail. closes #1147
How Has This Been Tested?
Tested locally making sure that the image is not built when the script fails