Skip to content

Commit

Permalink
fix: better error output when gulp add-version-files fails
Browse files Browse the repository at this point in the history
  • Loading branch information
edvald committed May 23, 2018
1 parent 8cc8c63 commit 0fc4ee4
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions gulpfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,22 @@ gulp.task("add-version-files", (cb) => {
proc.on("error", err => cb(err))

let output = ""
proc.stdout.on("data", d => output += d)
let outputWithError = ""
proc.stdout.on("data", d => {
output += d
outputWithError += d
})
proc.stderr.on("data", d => outputWithError += d)

proc.on("close", () => {
const results = JSON.parse(output)
let results
try {
results = JSON.parse(output)
} catch {
const msg = "Got unexpected output from `garden scan`"
console.error(msg + "\n" + outputWithError)
return cb(msg)
}

for (const module of <any>results.result) {
const relPath = relative(__dirname, module.path)
Expand Down

0 comments on commit 0fc4ee4

Please sign in to comment.