MCPcopy Index your code
hub / github.com/cli/cli / Exists

Method Exists

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

Source from the content-addressed store, hash-verified

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