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

Method resolveWorkDir

pkg/tools/builtin/shell/shell.go:554–562  ·  view source on GitHub ↗

resolveWorkDir returns the effective working directory.

(cwd string)

Source from the content-addressed store, hash-verified

552
553// resolveWorkDir returns the effective working directory.
554func (h *shellHandler) resolveWorkDir(cwd string) string {
555 if cwd == "" || cwd == "." {
556 return h.workingDir
557 }
558 if !filepath.IsAbs(cwd) {
559 return filepath.Clean(filepath.Join(h.workingDir, cwd))
560 }
561 return cwd
562}
563
564// formatCommandOutput formats command output handling timeout, cancellation, and errors.
565func formatCommandOutput(timeoutCtx, ctx context.Context, err error, rawOutput string, timeout time.Duration) string {

Callers 3

RunShellMethod · 0.95
RunShellBackgroundMethod · 0.95
TestResolveWorkDirFunction · 0.95

Calls

no outgoing calls

Tested by 1

TestResolveWorkDirFunction · 0.76