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

Method Exists

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

Source from the content-addressed store, hash-verified

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