Skip to content

Commit

Permalink
fix: [RUN-84] Error code when running command (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
thibaultleouay authored Nov 4, 2024
1 parent 0978ce1 commit b26b808
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/commands/workflow/exec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit b26b808

Please sign in to comment.