heroku / heroku/cli

Heroku run: properly pipe stderr to stderr

Open
#1,835 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
889
Forks
236
Avg merge
2d 10h
Merged PRs (30d)
33

Description

This is a copy of https://github.com/heroku/legacy-cli/issues/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):

```bash
#!/bin/bash

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

Works locally:

```bash
$ ./script.sh
This is error output.

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

Doesn't work via heroku run:

```bash
$ heroku run ./script.sh 2> /dev/null
Running `bash` attached to terminal... up, run.6258
This is error output.
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.