From 5a80bc6eb5c68a95be387e846435c380bcb56ff0 Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Tue, 20 Apr 2021 17:20:07 +0300 Subject: [PATCH] build(docs-infra): exit with an error code if generating StackBlitz examples fails (#41725) Previously, failing to generate one or more StackBlitz examples would log the errors but exit the command successfully. This made it easy to miss such failures. This commit fixes this by exiting the process with an error code if generating one or more StackBlitz examples fails. (In order to be able to see all potential errors, all examples are attempted to be generated before exiting the process.) PR Close #41725 --- aio/tools/stackblitz-builder/builder.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/aio/tools/stackblitz-builder/builder.js b/aio/tools/stackblitz-builder/builder.js index 52fc3b1f1e..03099c4bcb 100644 --- a/aio/tools/stackblitz-builder/builder.js +++ b/aio/tools/stackblitz-builder/builder.js @@ -25,14 +25,19 @@ class StackblitzBuilder { // const stackblitzPaths = path.join(this.basePath, '**/testing/*stackblitz.json'); const stackblitzPaths = path.join(this.basePath, '**/*stackblitz.json'); const fileNames = globby.sync(stackblitzPaths, { ignore: ['**/node_modules/**'] }); + let failed = false; fileNames.forEach((configFileName) => { try { - // console.log('***'+configFileName) this._buildStackblitzFrom(configFileName); } catch (e) { + failed = true; console.log(e); } }); + + if (failed) { + process.exit(1); + } } _addDependencies(config, postData) {