MCPcopy Index your code
hub / github.com/coder/mux / writeFileString

Function writeFileString

src/node/utils/runtime/helpers.ts:85–100  ·  view source on GitHub ↗
(
  runtime: Runtime,
  path: string,
  content: string,
  abortSignal?: AbortSignal
)

Source from the content-addressed store, hash-verified

83 * Write string contents to a file atomically
84 */
85export async function writeFileString(
86 runtime: Runtime,
87 path: string,
88 content: string,
89 abortSignal?: AbortSignal
90): Promise<void> {
91 const stream = runtime.writeFile(path, abortSignal);
92 const writer = stream.getWriter();
93 try {
94 await writer.write(new TextEncoder().encode(content));
95 await writer.close();
96 } catch (err) {
97 writer.releaseLock();
98 throw err;
99 }
100}
101
102/**
103 * Result from reading a plan file with legacy migration support

Callers 15

ensureGitInfoExcludeFunction · 0.90
runWithHookFunction · 0.90
runPostHookFunction · 0.90
prepareToolInputFunction · 0.90
spawnProcessFunction · 0.90
executeFileEditOperationFunction · 0.90
createFileEditInsertToolFunction · 0.90
createMuxAgentsWriteToolFunction · 0.90

Calls 3

writeFileMethod · 0.65
writeMethod · 0.65
closeMethod · 0.65

Tested by

no test coverage detected