From f598cf8aafce1a2e9bf331fa5bad73a3cb6611e9 Mon Sep 17 00:00:00 2001 From: Patrick Quist Date: Wed, 7 Dec 2022 20:03:48 +0100 Subject: [PATCH] fix interpreting with multiple files (#4407) --- lib/base-compiler.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/base-compiler.ts b/lib/base-compiler.ts index 3aeb34b3f5e..8f181193d80 100644 --- a/lib/base-compiler.ts +++ b/lib/base-compiler.ts @@ -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,