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

Shell: Set set pipefail by default #18

Open
schnatterer opened this issue Jan 17, 2019 · 0 comments
Open

Shell: Set set pipefail by default #18

schnatterer opened this issue Jan 17, 2019 · 0 comments

Comments

@schnatterer
Copy link
Member

schnatterer commented Jan 17, 2019

Using the sh step is prone to error when using pipes.
It's good practice to set set -o pipefail in all bash scripts because otherwise:

cat missingFile | sed s/foo/bar/g

would return a non zero exit code, which is unexepcted and hard to debug.

So: Why doesn't ces-build-lib make life easier for us an prepend pipefail before every sh call?
E.g. like so: script.sh(returnStdout: true, script: "set -e && ${args}")
Note: set -o pipefail fails (haha) with
...script.sh: 1: set: Illegal option -o pipefail.

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

No branches or pull requests

1 participant