Skip to content

Commit

Permalink
Make sure that logs are shwon from inside the runner
Browse files Browse the repository at this point in the history
  • Loading branch information
orta committed Nov 7, 2018
1 parent 1e34f3b commit 5af84d8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

## Master

# 6.0.3

- Fix passing stdout from the sub-process back to the user - [@orta][]
- Fix handling a `"pending"` status update properly using Bitbucket API - [@sgtcoolguy][]
- Fix #614 - Posting status updates to Github using issue workflow broken - [@sgtcoolguy][]
- Fix vertical alignment in GitHub issue template - [@patrickkempff][]
Expand Down Expand Up @@ -1357,3 +1360,5 @@ Not usable for others, only stubs of classes etc. - [@orta][]
[@cwright017]: https://github.com/Cwright017
[@adamnoakes]: https://github.com/adamnoakes
[@johansteffner]: https://github.com/johansteffner
[@sgtcoolguy]: https://github.com/sgtcoolguy
[@patrickkempff]: https://github.com/patrickkempff
6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,14 @@
"cacheDirectory": ".jest/cache"
},
"lint-staged": {
"*.json": [
"*.@(json|md)": [
"yarn prettier --write",
"git add"
],
"*.@(ts|tsx)": [
"tslint --fix",
"yarn prettier --write",
"git add"
],
"*.md": [
"yarn prettier --write",
"git add"
]
},
"pkg": {
Expand Down
7 changes: 4 additions & 3 deletions source/commands/utils/runDangerSubprocess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,12 @@ export const runDangerSubprocess = (
if (!results && maybeJSONURL) {
d("Got JSON URL from STDOUT, results are at: \n" + maybeJSONURL)
results = JSON.parse(readFileSync(maybeJSONURL.replace("danger-results:/", ""), "utf8"))
}

if (!results && maybeJSON) {
} else if (!results && maybeJSON) {
d("Got JSON results from STDOUT, results: \n" + maybeJSON)
results = JSON.parse(maybeJSON)
} else {
// Pass it back to the user
console.log(data.toString())
}
})

Expand Down
2 changes: 1 addition & 1 deletion source/runner/Executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export class Executor {
let issueURL = undefined

if (failureCount + messageCount === 0) {
this.log("No issues or messages were sent. Removing any existing messages.")
this.log(`Found no issues or messages from Danger. Removing any existing messages on ${this.platform.name}.`)
await this.platform.deleteMainComment(dangerID)
const previousComments = await this.platform.getInlineComments(dangerID)
for (const comment of previousComments) {
Expand Down

0 comments on commit 5af84d8

Please sign in to comment.