MCPcopy
hub / github.com/cli/cli / loadManifest

Method loadManifest

pkg/cmd/extension/extension.go:224–237  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

222}
223
224func (e *Extension) loadManifest() (binManifest, error) {
225 var bm binManifest
226 dir, _ := filepath.Split(e.Path())
227 manifestPath := filepath.Join(dir, manifestName)
228 manifest, err := os.ReadFile(manifestPath)
229 if err != nil {
230 return bm, fmt.Errorf("could not open %s for reading: %w", manifestPath, err)
231 }
232 err = yaml.Unmarshal(manifest, &bm)
233 if err != nil {
234 return bm, fmt.Errorf("could not parse %s: %w", manifestPath, err)
235 }
236 return bm, nil
237}

Callers 4

URLMethod · 0.95
CurrentVersionMethod · 0.95
IsPinnedMethod · 0.95
OwnerMethod · 0.95

Calls 3

PathMethod · 0.95
JoinMethod · 0.80
ErrorfMethod · 0.65

Tested by

no test coverage detected