MCPcopy Create free account
hub / github.com/github/gh-aw / mergeFeatures

Function mergeFeatures

pkg/cli/devcontainer.go:314–326  ·  view source on GitHub ↗

mergeFeatures adds new features to existing features map, updating old copilot-cli versions

(existing DevcontainerFeatures, toAdd map[string]any)

Source from the content-addressed store, hash-verified

312
313// mergeFeatures adds new features to existing features map, updating old copilot-cli versions
314func 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
329func getCurrentRepoName() string {

Callers 1

ensureDevcontainerConfigFunction · 0.85

Calls 1

PrintfMethod · 0.45

Tested by

no test coverage detected