Skip to content

Redirect error messages to current standard error stream #528

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

Merged
merged 1 commit into from
Nov 1, 2017

Conversation

tonyta
Copy link
Contributor

@tonyta tonyta commented Oct 27, 2017

We had a script that ran a Rails migration. Since its output is noisy, we swallowed stdout. The exit code was 1 but there was no message because annotate_models puts its error messages to stdout instead of stderr.

This PR redirects error messages to the current standard error stream $stderr.

Before

$ bundle exec rake annotate_models >/dev/null
$ echo $?
1

After

$ bundle exec rake annotate_models >/dev/null
No models found in directory 'app/models'.
Either specify models on the command line, or use the --model-dir option.
Call 'annotate --help' for more info.
$ echo $?
1

@ctran ctran merged commit ba95021 into ctran:develop Nov 1, 2017
@ctran ctran added this to the v2.7.3 milestone Nov 1, 2017
@ctran ctran added the feature label Nov 1, 2017
@ctran
Copy link
Owner

ctran commented Nov 1, 2017

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants