(input WriteFileInput, execCtx ExecutionContext)
| 98 | } |
| 99 | |
| 100 | func BackfillWriteFileInput(input WriteFileInput, execCtx ExecutionContext) WriteFileInput { |
| 101 | path := input.FilePath |
| 102 | if path != "" && !filepath.IsAbs(path) { |
| 103 | cwd := stringFromExecCtx(execCtx, "cwd") |
| 104 | if cwd == "" { |
| 105 | cwd = "." |
| 106 | } |
| 107 | if resolved, err := filepath.Abs(filepath.Join(cwd, path)); err == nil { |
| 108 | path = resolved |
| 109 | } else { |
| 110 | path = filepath.Join(cwd, path) |
| 111 | } |
| 112 | } |
| 113 | return WriteFileInput{FilePath: path, Content: input.Content} |
| 114 | } |
| 115 | |
| 116 | func RenderBashToolUse(input BashInput) string { |
| 117 | command := input.Command |
no test coverage detected