From b26b80856c1a0b7db1392794a6327813bba9ae55 Mon Sep 17 00:00:00 2001 From: Thibault Le Ouay Date: Mon, 4 Nov 2024 01:09:56 +0100 Subject: [PATCH] fix: [RUN-84] Error code when running command (#41) --- src/commands/workflow/exec.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/commands/workflow/exec.ts b/src/commands/workflow/exec.ts index 0ef41c9..2745228 100644 --- a/src/commands/workflow/exec.ts +++ b/src/commands/workflow/exec.ts @@ -21,7 +21,10 @@ async function executeCommand(step: { command: string; args: string[] }) { await cmd.parse([...baseCmd, ...step.args]) } else { const baseCmd = step.command.split(' ').shift() || '' - await execCmd(baseCmd, [...step.command.split(' ').slice(1), ...step.args]) + const { success, code } = await execCmd(baseCmd, [...step.command.split(' ').slice(1), ...step.args]) + if (!success) { + throw new Error(`Command failed with code ${code}`) + } } } catch (e) { if (e instanceof Error) {