MCPcopy
hub / github.com/compiler-explorer/compiler-explorer / writeMultipleFiles

Method writeMultipleFiles

lib/base-compiler.ts:2075–2086  ·  view source on GitHub ↗
(files: FiledataPair[], dirPath: string)

Source from the content-addressed store, hash-verified

2073 }
2074
2075 protected async writeMultipleFiles(files: FiledataPair[], dirPath: string) {
2076 const filesToWrite: Promise<void>[] = [];
2077
2078 for (const file of files) {
2079 if (!file.filename) throw new Error('One of more files do not have a filename');
2080
2081 const fullpath = this.getExtraFilepath(dirPath, file.filename);
2082 filesToWrite.push(utils.outputTextFile(fullpath, file.contents));
2083 }
2084
2085 return Promise.all(filesToWrite);
2086 }
2087
2088 protected async writeAllFiles(dirPath: string, source: string, files: FiledataPair[]) {
2089 if (!source) throw new Error(`File ${this.compileFilename} has no content or file is missing`);

Callers 3

writeAllFilesMethod · 0.95
writeAllFilesCMakeMethod · 0.95
handleInterpretingMethod · 0.95

Calls 2

getExtraFilepathMethod · 0.95
pushMethod · 0.80

Tested by

no test coverage detected