Skip to content

Commit

Permalink
fix: return error on invalid ref config
Browse files Browse the repository at this point in the history
This "fixes" a panic that happens if the cmd or ref isn't defined for
a serial or parallel exec
  • Loading branch information
jahvon committed Oct 22, 2024
1 parent fd5bbc7 commit aca34bf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/runner/parallel/parallel.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ func handleExec(
}
case refConfig.Cmd != "":
exec = execUtils.ExecutableForCmd(parent, refConfig.Cmd, i)
default:
return errors.New("parallel executable must have a ref or cmd")
}

execPromptedEnv := make(map[string]string)
Expand Down
2 changes: 2 additions & 0 deletions internal/runner/serial/serial.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ func handleExec(
}
case refConfig.Cmd != "":
exec = execUtils.ExecutableForCmd(parent, refConfig.Cmd, i)
default:
return errors.New("serial executable must have a ref or cmd")
}
ctx.Logger.Debugf("executing %s (%d/%d)", exec.Ref(), i+1, len(serialSpec.Execs))

Expand Down

0 comments on commit aca34bf

Please sign in to comment.