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

Method Exists

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

Source from the content-addressed store, hash-verified

34}
35
36func (c RunLogCache) Exists(key string) (bool, error) {
37 _, err := os.Stat(c.filepath(key))
38 if err == nil {
39 return true, nil
40 }
41
42 if errors.Is(err, os.ErrNotExist) {
43 return false, nil
44 }
45
46 return false, fmt.Errorf("checking cache entry: %v", err)
47}
48
49func (c RunLogCache) Create(key string, content io.Reader) error {
50 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