MCPcopy Create free account
hub / github.com/VemtoOrg/vemto2 / manipulateFile

Method manipulateFile

src/main/base/FileSystem.ts:196–204  ·  view source on GitHub ↗
(filePath: string, callback: Function)

Source from the content-addressed store, hash-verified

194 }
195
196 manipulateFile(filePath: string, callback: Function): FileSystem {
197 let fileContent = this.readFile(filePath)
198
199 if(callback) {
200 fileContent = callback(fileContent)
201 }
202
203 return this.writeFile(filePath, fileContent)
204 }
205
206 readFileIfExists(filePath: string): string {
207 if(!this.fileExists(filePath)) return null

Callers

nothing calls this directly

Calls 2

readFileMethod · 0.95
writeFileMethod · 0.95

Tested by

no test coverage detected