From 8178480ed252b7a9e224674dfb2738dda05e8a09 Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Wed, 2 Dec 2020 15:27:26 +0300 Subject: [PATCH] build: add try catch to build-schematics script --- npm/ng-packs/scripts/build-schematics.ts | 26 ++++++++++++++---------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/npm/ng-packs/scripts/build-schematics.ts b/npm/ng-packs/scripts/build-schematics.ts index 06d3ca5793..9f2c60d55e 100644 --- a/npm/ng-packs/scripts/build-schematics.ts +++ b/npm/ng-packs/scripts/build-schematics.ts @@ -49,18 +49,22 @@ async function* copyPackageFiles(packageName: string) { } (async () => { - await fse.remove(`../dist/${PACKAGE_TO_BUILD}`); + try { + await fse.remove(`../dist/${PACKAGE_TO_BUILD}`); - await execa( - 'tsc', - ['-p', `packages/${PACKAGE_TO_BUILD}/tsconfig.json`, '--outDir', `dist/${PACKAGE_TO_BUILD}`], - { - stdout: 'inherit', - cwd: '../', - }, - ); + await execa( + 'tsc', + ['-p', `packages/${PACKAGE_TO_BUILD}/tsconfig.json`, '--outDir', `dist/${PACKAGE_TO_BUILD}`], + { + stdout: 'inherit', + cwd: '../', + }, + ); - for await (const filecopy of copyPackageFiles(PACKAGE_TO_BUILD)) { - // do nothing + for await (const filecopy of copyPackageFiles(PACKAGE_TO_BUILD)) { + // do nothing + } + } catch (error) { + process.exit(1); } })();