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

Heroku run: properly pipe stderr to stderr #1835

Open
jrochkind opened this issue Jun 29, 2021 · 0 comments
Open

Heroku run: properly pipe stderr to stderr #1835

jrochkind opened this issue Jun 29, 2021 · 0 comments

Comments

@jrochkind
Copy link

jrochkind commented Jun 29, 2021

This is a copy of heroku/legacy-cli#1214 (2014) on old project. The behavior still exists, and is still a problem for me for exactly reasons original reporter explained well, I'll just copy it:


Right now, all output from a heroku run session seems to be returned on stdout.

I'm running a script via heroku run as part of a workflow, and I've hit a snag since the script I'm running outputs to stderr too, and I want to ignore that output.

Simple test case (e.g. script.sh):

#!/bin/bash

# via: http://stackoverflow.com/questions/2990414/echo-that-outputs-to-stderr
erro() { echo "$@" 1>&2; }
erro 'This is error output.'

Works locally:

$ ./script.sh
This is error output.

$ ./script.sh 2> /dev/null
(no output)

Doesn't work via heroku run:

$ heroku run ./script.sh 2> /dev/null
Running `bash` attached to terminal... up, run.6258
This is error output.
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