Skip to content

Commit 2198ca8

Browse files
committed
fix(scripts): fix spawn util
1 parent 6d5da33 commit 2198ca8

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Diff for: packages/scripts/src/utils/run.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,15 @@ import { getArgs } from './args.js'
1313
export async function runSerial(pm, scripts, pkg) {
1414
const cmds = scripts.map(script => getArgs(pm, script, pkg))
1515
let exitCode = 0
16+
let result
1617

1718
for (const [bin, args] of cmds) {
18-
exitCode = exitCode || (await spawn(bin, args)).exitCode
19+
result = await spawn(bin, args)
20+
exitCode = exitCode || result.exitCode
21+
22+
if (result.output) {
23+
process.stdout.write(result.output)
24+
}
1925
}
2026

2127
return exitCode

Diff for: packages/scripts/src/utils/spawn.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function spawn(cmd, args, stdio = true) {
2525
const onDone = (error) => {
2626
resolve({
2727
exitCode: child.exitCode,
28-
output: output || error
28+
output: output || (typeof error === 'number' ? '' : `${error}\n`)
2929
})
3030
}
3131

0 commit comments

Comments
 (0)