MCPcopy Index your code
hub / github.com/coder/coder / detectFileDump

Function detectFileDump

coderd/x/chatd/chattool/execute.go:370–378  ·  view source on GitHub ↗

detectFileDump checks whether the command matches a file-dump pattern and returns an advisory note, or empty string if no match.

(command string)

Source from the content-addressed store, hash-verified

368// pattern and returns an advisory note, or empty string if no
369// match.
370func detectFileDump(command string) string {
371 for _, pat := range fileDumpPatterns {
372 if pat.MatchString(command) {
373 return "Consider using read_file instead of " +
374 "dumping file contents with shell commands."
375 }
376 }
377 return ""
378}
379
380const (
381 // defaultProcessOutputTimeout is the default time the

Callers 1

executeForegroundFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected