WriteConfig is Plan + Apply. Used by cli/launch.go.
(tool Tool, endpoint providers.Endpoint, endpointName, model, apiKey string)
| 123 | |
| 124 | // WriteConfig is Plan + Apply. Used by cli/launch.go. |
| 125 | func WriteConfig(tool Tool, endpoint providers.Endpoint, endpointName, model, apiKey string) (string, error) { |
| 126 | plan, err := Plan(tool, endpoint, endpointName, model, apiKey) |
| 127 | if err != nil { |
| 128 | return "", err |
| 129 | } |
| 130 | path, err := Apply(tool, plan) |
| 131 | if err != nil { |
| 132 | return "", err |
| 133 | } |
| 134 | if err := codexPostWrite(tool, endpointName, model, path); err != nil { |
| 135 | return "", err |
| 136 | } |
| 137 | return path, nil |
| 138 | } |
| 139 | |
| 140 | func containsArraySegment(parts []string) bool { |
| 141 | for _, p := range parts { |