Skip to content

Commit aca34bf

Browse files
committed
fix: return error on invalid ref config
This "fixes" a panic that happens if the cmd or ref isn't defined for a serial or parallel exec
1 parent fd5bbc7 commit aca34bf

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

internal/runner/parallel/parallel.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ func handleExec(
7070
}
7171
case refConfig.Cmd != "":
7272
exec = execUtils.ExecutableForCmd(parent, refConfig.Cmd, i)
73+
default:
74+
return errors.New("parallel executable must have a ref or cmd")
7375
}
7476

7577
execPromptedEnv := make(map[string]string)

internal/runner/serial/serial.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ func handleExec(
6363
}
6464
case refConfig.Cmd != "":
6565
exec = execUtils.ExecutableForCmd(parent, refConfig.Cmd, i)
66+
default:
67+
return errors.New("serial executable must have a ref or cmd")
6668
}
6769
ctx.Logger.Debugf("executing %s (%d/%d)", exec.Ref(), i+1, len(serialSpec.Execs))
6870

0 commit comments

Comments
 (0)