From 90e56e2f074810a42866205de1fe1989b4e183ca Mon Sep 17 00:00:00 2001 From: Cory LaViska Date: Thu, 8 Jun 2023 15:05:39 -0400 Subject: [PATCH] don't swallow errors --- scripts/build.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/build.js b/scripts/build.js index b6b2ade1..df799289 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -11,7 +11,6 @@ import getPort, { portNumbers } from 'get-port'; import ora from 'ora'; import util from 'util'; -const execPromise = util.promisify(exec); const { bundle, copydir, dir, serve, types } = commandLineArgs([ { name: 'bundle', type: Boolean }, { name: 'copydir', type: String }, @@ -21,6 +20,7 @@ const { bundle, copydir, dir, serve, types } = commandLineArgs([ const outdir = 'dist'; const sitedir = '_site'; const spinner = ora({ hideCursor: false }).start(); +const execPromise = util.promisify(exec); let childProcess; let buildResult; @@ -143,6 +143,8 @@ async function nextTask(label, action) { } catch (err) { spinner.stop(); console.error(`${chalk.red('✘')} ${err}`); + if (err.stdout) console.error(chalk.red(err.stdout)); + if (err.stderr) console.error(chalk.red(err.stderr)); process.exit(1); } }