MCPcopy Create free account
hub / github.com/docker/docker-agent / providesCommand

Function providesCommand

pkg/toolinstall/registry.go:258–265  ·  view source on GitHub ↗

providesCommand returns true if any of the package's files entries has a binary matching the given command name.

(pkg *Package, command string)

Source from the content-addressed store, hash-verified

256// providesCommand returns true if any of the package's files entries has
257// a binary matching the given command name.
258func providesCommand(pkg *Package, command string) bool {
259 for _, f := range pkg.Files {
260 if f.Name == command {
261 return true
262 }
263 }
264 return false
265}
266
267// fetchIndex fetches and parses the full registry index.
268// The raw YAML is cached to disk; on fetch failure the cached copy is used.

Callers 2

TestProvidesCommandFunction · 0.85
LookupByCommandMethod · 0.85

Calls

no outgoing calls

Tested by 1

TestProvidesCommandFunction · 0.68