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

Method Exists

pkg/cmd/run/view/view.go:37–48  ·  view source on GitHub ↗
(key string)

Source from the content-addressed store, hash-verified

35}
36
37func (c RunLogCache) Exists(key string) (bool, error) {
38 _, err := os.Stat(c.filepath(key))
39 if err == nil {
40 return true, nil
41 }
42
43 if errors.Is(err, os.ErrNotExist) {
44 return false, nil
45 }
46
47 return false, fmt.Errorf("checking cache entry: %v", err)
48}
49
50func (c RunLogCache) Create(key string, content io.Reader) error {
51 if err := os.MkdirAll(c.cacheDir, 0755); err != nil {

Callers 2

TestRunLogFunction · 0.95
getRunLogFunction · 0.80

Calls 2

filepathMethod · 0.95
ErrorfMethod · 0.65

Tested by 1

TestRunLogFunction · 0.76