MCPcopy Create free account
hub / github.com/diillson/chatcli / LoadFile

Method LoadFile

cli/workspace/bootstrap.go:80–94  ·  view source on GitHub ↗

LoadFile loads a single bootstrap file (workspace first, then global).

(filename string)

Source from the content-addressed store, hash-verified

78
79// LoadFile loads a single bootstrap file (workspace first, then global).
80func (bl *BootstrapLoader) LoadFile(filename string) (string, bool) {
81 // Try workspace first
82 workspacePath := filepath.Join(bl.workspaceDir, filename)
83 if content, ok := bl.loadWithCache(workspacePath); ok {
84 return content, true
85 }
86
87 // Fall back to global
88 globalPath := filepath.Join(bl.globalDir, filename)
89 if content, ok := bl.loadWithCache(globalPath); ok {
90 return content, true
91 }
92
93 return "", false
94}
95
96// IsStale checks if any cached file has been modified on disk.
97func (bl *BootstrapLoader) IsStale() bool {

Callers 5

TestCacheInvalidationFunction · 0.95
TestIsStaleFunction · 0.95
LoadBootstrapContentMethod · 0.95

Calls 1

loadWithCacheMethod · 0.95

Tested by 4

TestCacheInvalidationFunction · 0.76
TestIsStaleFunction · 0.76