MCPcopy Create free account
hub / github.com/cli/cli / updatePath

Method updatePath

script/ghmock/schemafiles.go:99–104  ·  view source on GitHub ↗

updatePath is where ghmock schemas update writes the file: the path in the environment variable if it's set, because that's the file ghmock uses, and the cache otherwise.

()

Source from the content-addressed store, hash-verified

97// environment variable if it's set, because that's the file ghmock uses, and
98// the cache otherwise.
99func (s schemaSource) updatePath() (string, error) {
100 if p := os.Getenv(s.envVar); p != "" {
101 return p, nil
102 }
103 return s.cachePath()
104}
105
106// download fetches the file to path. It checks the file and writes it to a
107// temporary file first, so a failed download never replaces a good copy.

Callers 1

cmdSchemasFunction · 0.80

Calls 1

cachePathMethod · 0.95

Tested by

no test coverage detected