mergeFeatures adds new features to existing features map, updating old copilot-cli versions
(existing DevcontainerFeatures, toAdd map[string]any)
| 312 | |
| 313 | // mergeFeatures adds new features to existing features map, updating old copilot-cli versions |
| 314 | func mergeFeatures(existing DevcontainerFeatures, toAdd map[string]any) { |
| 315 | // First, remove old copilot-cli versions |
| 316 | for key := range existing { |
| 317 | if strings.HasPrefix(key, "ghcr.io/devcontainers/features/copilot-cli:") && |
| 318 | key != "ghcr.io/devcontainers/features/copilot-cli:latest" { |
| 319 | delete(existing, key) |
| 320 | devcontainerLog.Printf("Removed old copilot-cli version: %s", key) |
| 321 | } |
| 322 | } |
| 323 | |
| 324 | // Add new features |
| 325 | maps.Copy(existing, toAdd) |
| 326 | } |
| 327 | |
| 328 | // getCurrentRepoName gets the current repository name from git remote in owner/repo format |
| 329 | func getCurrentRepoName() string { |
no test coverage detected