Skip to content

Commit

Permalink
fix interpreting with multiple files (#4407)
Browse files Browse the repository at this point in the history
  • Loading branch information
partouf authored and mattgodbolt committed Jan 24, 2023
1 parent 71ed375 commit 6f007fc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/base-compiler.ts
Expand Up @@ -1562,8 +1562,17 @@ export class BaseCompiler implements ICompiler {
const source = key.source;
const dirPath = await this.newTempDir();
const outputFilename = this.getExecutableFilename(dirPath, this.outputFilebase);

// cant use this.writeAllFiles here because outputFilename is used as the file to execute
// instead of inputFilename

await fs.writeFile(outputFilename, source);
if (key.files && key.files.length > 0) {
await this.writeMultipleFiles(key.files, dirPath);
}

executeParameters.args.unshift(outputFilename);

const result = await this.runExecutable(this.compiler.exe, executeParameters, dirPath);
return {
...result,
Expand Down

0 comments on commit 6f007fc

Please sign in to comment.