MCPcopy Index your code
hub / github.com/freshframework/fresh / writeFiles

Function writeFiles

packages/fresh/src/test_utils.ts:206–220  ·  view source on GitHub ↗
(dir: string, files: Record<string, string>)

Source from the content-addressed store, hash-verified

204}
205
206export async function writeFiles(dir: string, files: Record<string, string>) {
207 const entries = Object.entries(files);
208 await Promise.all(entries.map(async (entry) => {
209 const [pathname, content] = entry;
210 const fullPath = path.join(dir, pathname);
211 try {
212 await Deno.mkdir(path.dirname(fullPath), { recursive: true });
213 await Deno.writeTextFile(fullPath, content);
214 } catch (err) {
215 if (!(err instanceof Deno.errors.AlreadyExists)) {
216 throw err;
217 }
218 }
219 }));
220}

Callers 2

builder_test.tsFile · 0.90
update_test.tsFile · 0.90

Calls 1

allMethod · 0.80

Tested by

no test coverage detected