From fa9bc551cfd03368ac7d6d019e2e031365c970b4 Mon Sep 17 00:00:00 2001 From: Pierre Millot Date: Wed, 23 Mar 2022 17:47:25 +0100 Subject: [PATCH] fix(scripts): allow stderr to pass through --- .gitignore | 1 + scripts/common.ts | 22 +++++++++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 273f78ec23..a41aa410dd 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ target **/.DS_Store .gradle build +pom.xml dist diff --git a/scripts/common.ts b/scripts/common.ts index 95a6dfeaaa..ba8ec31f33 100644 --- a/scripts/common.ts +++ b/scripts/common.ts @@ -117,14 +117,22 @@ export async function run( try { if (verbose) { return ( - await execa.command(command, { - stdout: 'inherit', - shell: 'bash', - cwd, - }) - ).stdout; + ( + await execa.command(command, { + stdout: 'inherit', + stderr: 'inherit', + stdin: 'inherit', + all: true, + shell: 'bash', + cwd, + }) + ).all ?? '' + ); } - return (await execa.command(command, { shell: 'bash', cwd })).stdout; + return ( + (await execa.command(command, { shell: 'bash', all: true, cwd })).all ?? + '' + ); } catch (err) { if (errorMessage) { throw new Error(`[ERROR] ${errorMessage}`);