Skip to content

Commit

Permalink
Read extension install status from report (#453)
Browse files Browse the repository at this point in the history
The installation result was hardcoded to always be `success`, because
previously we couldn't track it. But since PR #409 we now run the
`node-gyp` command from the `extension.js` install script so we can
track the installation result.

Read the status from the report so the diagnose report is more accurate.

Since there are more fields in case of an error or failure, print those
as well if present.
  • Loading branch information
tombruijn authored Oct 11, 2021
1 parent bfa4083 commit ad6be4f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
bump: "patch"
---

Fix diagnose installation status reporting. It previously always reported "success", but will now also print failures.
12 changes: 11 additions & 1 deletion packages/nodejs/src/cli/diagnose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,17 @@ export class Diagnose {

console.log(`Extension installation report`)
console.log(` Installation result`)
console.log(` Status: success`)
const installReport = data["installation"]
console.log(` Status: ${installReport["result"]["status"]}`)
const resultMessage = data["installation"]["result"]["message"]
if (resultMessage) {
console.log(` Message: ${resultMessage}`)
}
const resultError = data["installation"]["result"]["error"]
if (resultError) {
console.log(` Error: ${resultError}`)
}

console.log(` Language details`)
console.log(
` Node.js version: ${data["installation"]["language"]["version"]}`
Expand Down

0 comments on commit ad6be4f

Please sign in to comment.