From 59005945620669974a6d41b40293e13fb2c72d2f Mon Sep 17 00:00:00 2001 From: Cory LaViska Date: Mon, 9 Aug 2021 08:33:30 -0400 Subject: [PATCH] exit on startup when scripts fail --- scripts/build.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/scripts/build.js b/scripts/build.js index a24da47a..67395c62 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -19,11 +19,15 @@ const { dev } = commandLineArgs({ name: 'dev', type: Boolean }); del.sync('./dist'); -if (!dev) execSync('tsc', { stdio: 'inherit' }); // for type declarations -execSync('node scripts/make-metadata.js', { stdio: 'inherit' }); -execSync('node scripts/make-vscode-data.js', { stdio: 'inherit' }); -execSync('node scripts/make-css.js', { stdio: 'inherit' }); -execSync('node scripts/make-icons.js', { stdio: 'inherit' }); +try { + if (!dev) execSync('tsc', { stdio: 'inherit' }); // for type declarations + execSync('node scripts/make-metadata.js', { stdio: 'inherit' }); + execSync('node scripts/make-vscode-data.js', { stdio: 'inherit' }); + execSync('node scripts/make-css.js', { stdio: 'inherit' }); +} catch (err) { + console.error(chalk.red(err)); + process.exit(1); +} (async () => { const entryPoints = [