MCPcopy Create free account
hub / github.com/cloudflare/agents / replaceInFiles

Method replaceInFiles

packages/shell/src/memory.ts:234–250  ·  view source on GitHub ↗
(
    pattern: string,
    search: string,
    replacement: string,
    options?: StateReplaceInFilesOptions
  )

Source from the content-addressed store, hash-verified

232 }
233
234 async replaceInFiles(
235 pattern: string,
236 search: string,
237 replacement: string,
238 options?: StateReplaceInFilesOptions
239 ): Promise<StateReplaceInFilesResult> {
240 const paths = await this.getFilePaths(pattern);
241 return collectFileReplaceResults(
242 paths,
243 this.readFile.bind(this),
244 this.writeFile.bind(this),
245 this.deleteFile.bind(this),
246 search,
247 replacement,
248 options
249 );
250 }
251
252 async rm(path: string, options?: StateRmOptions): Promise<void> {
253 await this.fs.rm(path, options as RmOptions | undefined);

Callers

nothing calls this directly

Calls 2

getFilePathsMethod · 0.95

Tested by

no test coverage detected