Skip to content

Commit 02d0a0b

Browse files
authored
fix: always pipe stderr (#412)
* fix: always pipe stderr * fix: typo * chore: add changeset
1 parent 23e41b0 commit 02d0a0b

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.changeset/selfish-pens-greet.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@rnef/tools': patch
3+
---
4+
5+
Collect stderr stream for verbose mode in order to catch and report correct errors in the CLI.

packages/tools/src/lib/spawn.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@ export function spawn(
77
args?: readonly string[],
88
options?: Options
99
): Subprocess {
10+
const defaultStream = logger.isVerbose() ? 'inherit' : 'pipe';
1011
const defaultOptions: Options = {
11-
stdio: logger.isVerbose() ? 'inherit' : 'pipe',
12+
stdin: defaultStream,
13+
stdout: defaultStream,
14+
// Always 'pipe' stderr to handle errors properly down the line
15+
stderr: 'pipe',
1216
};
1317
logger.debug(`Running: ${file}`, ...(args ?? []));
1418
const childProcess = nanoSpawn(file, args, { ...defaultOptions, ...options });

0 commit comments

Comments
 (0)