Cli: heroku run exits with 0 even if the command fails

Created on 10 Sep 2019  Â·  2Comments  Â·  Source: heroku/cli

heroku run exits with 0 even if the command fails, it should exit with 1 instead (or the error code returned from the respective command):

$ heroku update
heroku: Updating CLI... already on latest version: 7.29.0
Updating completions... done
$ DEBUG=true heroku run fail -a [app]
Running fail on ⬢ [app]... up, run.7787 (Standard-1X)
bash: fail: command not found
$ echo $?
0

(run on macOS, not behind any proxy)

Most helpful comment

@RasPhilCo thanks! i had no idea this option exists. i still think this should be the default behavior, but it sounds like this is intentional, so i'll close this.

All 2 comments

From run's help:

$ heroku run --help
...
  -x, --exit-code      passthrough the exit code of the remote command
...

@RasPhilCo thanks! i had no idea this option exists. i still think this should be the default behavior, but it sounds like this is intentional, so i'll close this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JBallin picture JBallin  Â·  6Comments

rpsadarangani picture rpsadarangani  Â·  5Comments

noenthu picture noenthu  Â·  7Comments

edmorley picture edmorley  Â·  3Comments

kmulqueen picture kmulqueen  Â·  3Comments