From 607af3cc06c8cd9915ff246f7667075a08ac259f Mon Sep 17 00:00:00 2001 From: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Date: Thu, 20 Jan 2022 09:31:21 +0100 Subject: [PATCH 1/2] fix: validate-manifest breaks on Node 12 --- scripts/validate-manifest.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/scripts/validate-manifest.js b/scripts/validate-manifest.js index 6138ad24a..b744719d3 100755 --- a/scripts/validate-manifest.js +++ b/scripts/validate-manifest.js @@ -47,12 +47,15 @@ function validateManifest(manifestPath = findAppManifest()) { console.error( `${manifestPath}: error: ${APP_JSON} is not a valid app manifest` ); - validate.errors?.map(({ instancePath, message }) => - console.error( - `${manifestPath}: error: ${instancePath || ""} ${message}` - ) - ); - process.exit(1); + const errors = validate.errors; + if (errors) { + errors.map(({ instancePath, message }) => + console.error( + `${manifestPath}: error: ${instancePath || ""} ${message}` + ) + ); + process.exit(1); + } } } From 7e7a30ee03ae4cbd20164213b5bb068a9cda0757 Mon Sep 17 00:00:00 2001 From: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Date: Thu, 20 Jan 2022 10:51:23 +0100 Subject: [PATCH 2/2] always exit with code 1 on error --- scripts/validate-manifest.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/validate-manifest.js b/scripts/validate-manifest.js index b744719d3..5da278266 100755 --- a/scripts/validate-manifest.js +++ b/scripts/validate-manifest.js @@ -54,8 +54,8 @@ function validateManifest(manifestPath = findAppManifest()) { `${manifestPath}: error: ${instancePath || ""} ${message}` ) ); - process.exit(1); } + process.exit(1); } }