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

Method writeAllFiles

lib/compilers/co2.ts:79–95  ·  view source on GitHub ↗
(dirPath: string, source: string, files: FiledataPair[])

Source from the content-addressed store, hash-verified

77 }
78
79 override async writeAllFiles(dirPath: string, source: string, files: FiledataPair[]) {
80 if (!source) throw new Error(`File ${this.compileFilename} has no content or file is missing`);
81
82 const co2Filename = path.join(dirPath, this.compileFilename);
83 await fs.writeFile(co2Filename, source);
84
85 const rsFilename = path.join(dirPath, 'example.rs');
86 await fs.writeFile(rsFilename, '#![language(co2)]\n');
87
88 if (files && files.length > 0) {
89 await this.writeMultipleFiles(files, dirPath);
90 }
91
92 return {
93 inputFilename: rsFilename,
94 };
95 }
96
97 override processExecutionResult(input: UnprocessedExecResult, inputFilename?: string): BasicExecutionResult {
98 const dirPath = inputFilename ? path.dirname(inputFilename) : undefined;

Callers

nothing calls this directly

Calls 1

writeMultipleFilesMethod · 0.45

Tested by

no test coverage detected