resolveWorkDir returns the effective working directory.
(cwd string)
| 552 | |
| 553 | // resolveWorkDir returns the effective working directory. |
| 554 | func (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. |
| 565 | func formatCommandOutput(timeoutCtx, ctx context.Context, err error, rawOutput string, timeout time.Duration) string { |
no outgoing calls