From ad6be4f38a6caff7fdfa06ae1d1ef51145bc004d Mon Sep 17 00:00:00 2001 From: Tom de Bruijn Date: Mon, 11 Oct 2021 16:33:49 +0200 Subject: [PATCH] Read extension install status from report (#453) 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. --- .../.changesets/fix-diagnose-installation-status.md | 5 +++++ packages/nodejs/src/cli/diagnose.ts | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 packages/nodejs/.changesets/fix-diagnose-installation-status.md diff --git a/packages/nodejs/.changesets/fix-diagnose-installation-status.md b/packages/nodejs/.changesets/fix-diagnose-installation-status.md new file mode 100644 index 00000000..4ce6c665 --- /dev/null +++ b/packages/nodejs/.changesets/fix-diagnose-installation-status.md @@ -0,0 +1,5 @@ +--- +bump: "patch" +--- + +Fix diagnose installation status reporting. It previously always reported "success", but will now also print failures. diff --git a/packages/nodejs/src/cli/diagnose.ts b/packages/nodejs/src/cli/diagnose.ts index 0ecad068..0d6f3704 100644 --- a/packages/nodejs/src/cli/diagnose.ts +++ b/packages/nodejs/src/cli/diagnose.ts @@ -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"]}`