MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / instructionForFile

Method instructionForFile

internal/instructions/install.go:163–175  ·  view source on GitHub ↗

instructionForFile returns the instruction whose managed file equals path.

(ctx context.Context, path string)

Source from the content-addressed store, hash-verified

161
162// instructionForFile returns the instruction whose managed file equals path.
163func (s *Store) instructionForFile(ctx context.Context, path string) (Instruction, bool) {
164 list, err := s.List(ctx)
165 if err != nil {
166 return Instruction{}, false
167 }
168 clean := filepath.Clean(path)
169 for _, in := range list {
170 if filepath.Clean(managedFilePath(in.Name)) == clean {
171 return in, true
172 }
173 }
174 return Instruction{}, false
175}
176
177// Uninstall removes the link/copy CAM placed (when safe) and deletes the row.
178func (s *Store) Uninstall(ctx context.Context, installID int64) error {

Callers 1

checkConflictMethod · 0.95

Calls 2

ListMethod · 0.95
managedFilePathFunction · 0.85

Tested by

no test coverage detected