MCPcopy Create free account
hub / github.com/compiler-explorer/compiler-explorer / outputTextFile

Function outputTextFile

lib/utils.ts:656–659  ·  view source on GitHub ↗
(filepath: string, contents: string)

Source from the content-addressed store, hash-verified

654 * Output a file, creating any necessary directories.
655 */
656export async function outputTextFile(filepath: string, contents: string): Promise<void> {
657 await fs.mkdir(path.dirname(filepath), {recursive: true});
658 await fs.writeFile(filepath, contents, 'utf-8');
659}
660
661/**
662 * Create an empty file (and directories leading to it), leaving it alone if already present.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected