MCPcopy
hub / github.com/AutoMaker-Org/automaker / writeFile

Function writeFile

libs/platform/src/secure-fs.ts:180–190  ·  view source on GitHub ↗
(
  filePath: string,
  data: string | Buffer,
  optionsOrEncoding?: BufferEncoding | WriteFileOptions
)

Source from the content-addressed store, hash-verified

178 * Wrapper around fs.writeFile that validates path first
179 */
180export async function writeFile(
181 filePath: string,
182 data: string | Buffer,
183 optionsOrEncoding?: BufferEncoding | WriteFileOptions
184): Promise<void> {
185 const validatedPath = validatePath(filePath);
186 return executeWithRetry(
187 () => fs.writeFile(validatedPath, data, optionsOrEncoding),
188 `writeFile(${filePath})`
189 );
190}
191
192/**
193 * Wrapper around fs.mkdir that validates path first

Callers

nothing calls this directly

Calls 3

validatePathFunction · 0.85
executeWithRetryFunction · 0.85
writeFileMethod · 0.80

Tested by

no test coverage detected