diff --git a/src/main.ts b/src/main.ts index ad21faf..1d8a3d3 100644 --- a/src/main.ts +++ b/src/main.ts @@ -200,7 +200,7 @@ app.whenReady().then(() => { deleteFile(file); // Delete the 2 pass temporary files - deleteTwoPassFiles(file); + deleteTwoPassFiles(process.cwd()); return finalFile; }; diff --git a/src/utils/misc.ts b/src/utils/misc.ts index b4552b5..95d66d2 100644 --- a/src/utils/misc.ts +++ b/src/utils/misc.ts @@ -47,11 +47,8 @@ export const deleteFile = (file: string) => { }); }; -/** Delete the 2pass files generated by ffmpeg, we're using - * the file location to know in which directory they are. - * We're checking first if they exists where we are looking at. */ -export const deleteTwoPassFiles = (file: string) => { - const directory = path.parse(file).dir; +/** Delete the 2pass files generated by ffmpeg */ +export const deleteTwoPassFiles = (directory: string) => { const logFile = path.join(directory, "ffmpeg2pass-0.log"); if (existsSync(logFile)) {