From 392740475840c8479463f11dc9e130427b79ee08 Mon Sep 17 00:00:00 2001 From: bluwy Date: Wed, 12 Jun 2024 14:08:54 +0800 Subject: [PATCH] fix: delete execa std props --- utils.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/utils.ts b/utils.ts index 717af909..3fff8e8a 100644 --- a/utils.ts +++ b/utils.ts @@ -48,7 +48,18 @@ export async function $(literals: TemplateStringsArray, ...values: any[]) { proc.stdin && process.stdin.pipe(proc.stdin) proc.stdout && proc.stdout.pipe(process.stdout) proc.stderr && proc.stderr.pipe(process.stderr) - const result = await proc + + let result + try { + result = await proc + } catch (error) { + // Since we already piped the io to the parent process, we remove the duplicated + // messages here so it's easier to read the error message. + if (error.stdout) error.stdout = 'value removed by vite-ecosystem-ci' + if (error.stderr) error.stderr = 'value removed by vite-ecosystem-ci' + if (error.stdio) error.stdio = ['value removed by vite-ecosystem-ci'] + throw error + } if (isGitHubActions) { actionsCore.endGroup()