From ad752b7bd0d89bd7a069e43a74af6896ba08a785 Mon Sep 17 00:00:00 2001 From: Vito De Tullio Date: Wed, 14 Sep 2022 15:01:35 +0200 Subject: [PATCH] use outputPath to check if thi is a new file (#691) * use outputPath to check if thi is a new file * use case-insensitive check roku fs is case-insensitive --- src/Program.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Program.ts b/src/Program.ts index a7352ec78..2f9e15314 100644 --- a/src/Program.ts +++ b/src/Program.ts @@ -1388,13 +1388,13 @@ export class Program { public async transpile(fileEntries: FileObj[], stagingFolderPath: string) { const { entries, getOutputPath, astEditor } = this.beforeProgramTranspile(fileEntries, stagingFolderPath); - const processedFiles = new Set(); + const processedFiles = new Set(); const transpileFile = async (srcPath: string, outputPath?: string) => { //find the file in the program const file = this.getFile(srcPath); //mark this file as processed so we don't process it more than once - processedFiles.add(file); + processedFiles.add(outputPath?.toLowerCase()); //skip transpiling typedef files if (isBrsFile(file) && file.isTypedef) { @@ -1437,9 +1437,10 @@ export class Program { for (const key in this.files) { const file = this.files[key]; //this is a new file - if (!processedFiles.has(file)) { + const outputPath = getOutputPath(file); + if (!processedFiles.has(outputPath?.toLowerCase())) { promises.push( - transpileFile(file?.srcPath, getOutputPath(file)) + transpileFile(file?.srcPath, outputPath) ); } }