diff --git a/packages/scripts/src/utils/run.js b/packages/scripts/src/utils/run.js index 0599a5e..4ffea72 100644 --- a/packages/scripts/src/utils/run.js +++ b/packages/scripts/src/utils/run.js @@ -13,9 +13,15 @@ import { getArgs } from './args.js' export async function runSerial(pm, scripts, pkg) { const cmds = scripts.map(script => getArgs(pm, script, pkg)) let exitCode = 0 + let result for (const [bin, args] of cmds) { - exitCode = exitCode || (await spawn(bin, args)).exitCode + result = await spawn(bin, args) + exitCode = exitCode || result.exitCode + + if (result.output) { + process.stdout.write(result.output) + } } return exitCode diff --git a/packages/scripts/src/utils/spawn.js b/packages/scripts/src/utils/spawn.js index 9e5e981..cc4b76d 100644 --- a/packages/scripts/src/utils/spawn.js +++ b/packages/scripts/src/utils/spawn.js @@ -25,7 +25,7 @@ export function spawn(cmd, args, stdio = true) { const onDone = (error) => { resolve({ exitCode: child.exitCode, - output: output || error + output: output || (typeof error === 'number' ? '' : `${error}\n`) }) }