MCPcopy
hub / github.com/docker/docker-agent / commandHandler

Struct commandHandler

pkg/hooks/handler.go:216–222  ·  view source on GitHub ↗

commandHandler runs a hook by exec'ing its command under a shell.

Source from the content-addressed store, hash-verified

214
215// commandHandler runs a hook by exec'ing its command under a shell.
216type commandHandler struct {
217 workingDir string
218 env []string
219 shell string
220 shellArgs []string
221 command string
222}
223
224func (h *commandHandler) Run(ctx context.Context, input []byte) (HandlerResult, error) {
225 cmd := exec.CommandContext(ctx, h.shell, append(h.shellArgs, h.command)...)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected