Skip to content

Commit

Permalink
Passes through non-zero child process exit codes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ashfurrow committed Oct 1, 2017
1 parent 603c40f commit bd4cd96
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// I'm adding it without a version number since I don't know what version it'll be if/when this is merged <_<

- Improve CircleCI PR detection
- Passes through non-zero exit codes from `danger process` runs - ashfurrow

### 2.0.0-alpha.16

Expand Down
3 changes: 2 additions & 1 deletion source/commands/utils/runDangerSubprocess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ const runDangerSubprocess = (subprocessName: string, dslJSONString: string, exec
child.on("close", async code => {
console.log(`child process exited with code ${code}`)
// Submit an error back to the PR
if (process.exitCode) {
if (code) {
process.exitCode = code
const results = resultsWithFailure(`${subprocessName}\` failed.`, "### Log\n\n" + markdownCode(allLogs))
await exec.handleResults(results)
}
Expand Down

0 comments on commit bd4cd96

Please sign in to comment.