Skip to content

Commit

Permalink
fix(scripts): allow stderr to pass through (#282)
Browse files Browse the repository at this point in the history
  • Loading branch information
millotp authored Mar 24, 2022
1 parent fbc672c commit 2e5e1ad
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ target
**/.DS_Store
.gradle
build
pom.xml

dist

Expand Down
22 changes: 15 additions & 7 deletions scripts/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand Down

0 comments on commit 2e5e1ad

Please sign in to comment.