From 63fd8b683a29ef2132c96df059cd5c76b7e18c6c Mon Sep 17 00:00:00 2001 From: David Matter Date: Tue, 6 Aug 2024 08:34:31 +0200 Subject: [PATCH] ci: fix canary release workflow (#11516) --- scripts/utils.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/utils.js b/scripts/utils.js index 2050b05b7cd..056d95b7b09 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -95,8 +95,17 @@ export async function exec(command, args, options) { const ok = code === 0 const stderr = Buffer.concat(stderrChunks).toString().trim() const stdout = Buffer.concat(stdoutChunks).toString().trim() - const result = { ok, code, stderr, stdout } - resolve(result) + + if (ok) { + const result = { ok, code, stderr, stdout } + resolve(result) + } else { + reject( + new Error( + `Failed to execute command: ${command} ${args.join(' ')}: ${stderr}`, + ), + ) + } }) }) }