-
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 ember:compile
if build subprocess fails
#418
Conversation
paths = build_paths(tee: "path/to/tee", log: "path/to/log") | ||
command = build_command(paths: paths) | ||
|
||
expect(command.build).to match(%r{\Aset -o pipefail;}) |
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 String#start_with?
instead of a regex match anchored to the beginning of the string.
06020e0
to
cee6c5f
Compare
I think you forgot to close your code block. |
Closes [#417][#417]. The following is the command `ember-cli-rails` generates for `rake ember:compile`. It was generated using [the example application][repo]. ```bash /Users/seanpdoyle/src/ember-cli-rails-heroku-example/frontend/node_modules/.bin/ember build --environment 'development' --output-path '/Users/seanpdoyle/src/ember-cli-rails-heroku-example/tmp/ember-cli/apps/frontend' | /usr/bin/tee -a '/Users/seanpdoyle/src/ember-cli-rails-heroku-example/log/ember-frontend.development.log' ``` Pipes are streaming, so the pipe to `tee` will open before the first program finishes writing, potentially ignoring a non-zero exit status. The solution is to set the [`pipefail`][docs] option for the generated sub-command. [repo]: https://github.com/seanpdoyle/ember-cli-rails-heroku-example [#417]: #417 [docs]: http://www.gnu.org/software/bash/manual/html_node/Pipelines.html
cee6c5f
to
59d20c0
Compare
I was frantically searching the code diff for a Ruby syntax error. 😶 I've corrected the commit message. |
I'm not familiar with this project so I don't know the details, but I did get here via an appeal to tbot/shell. If that string is to be read by a POSIX shell, you might want to know that:
If it's to be read by zsh, though, that will be fine. If you want something that works from the shell, you could get fancy with a pipe (inspired by StackOverflow here):
|
:sad-trombone: @mike-burns would |
Doesn't seem to do what you want. |
With the current version on this branch (b0ba573) the problem is back...
|
Just a suggestion: Why are you using You capture the whole output with |
Closing in favor of #420. |
Closes #417.
The following is the command
ember-cli-rails
generates forrake ember:compile
. It was generated using the example application.Pipes are streaming, so the pipe to
tee
will open before the firstprogram finishes writing, potentially ignoring a non-zero exit status.
The solution is to set the
pipefail
option for the generatedsub-command.