diff --git a/src/containers/job/JobManagerContainer.ts b/src/containers/job/JobManagerContainer.ts index 2606f348..28daef2a 100644 --- a/src/containers/job/JobManagerContainer.ts +++ b/src/containers/job/JobManagerContainer.ts @@ -575,9 +575,16 @@ export class JobManagerContainer extends Container { fileAssetsPaths.push(assetsPath); } } - const removeFileAssetsPaths = removeFilePaths - .filter(path => path.endsWith('.md')) - .map(path => path.substring(0, path.length - 3) + '.assets'); + const removeFileAssetsPaths = []; + for (const fileToRemove of removeFilePaths + .filter(path => path.endsWith('.md')) + .map(path => path.substring(0, path.length - 3) + '.assets')) { + + if (!await transformedFileSystem.exists(fileToRemove)) { + continue; + } + removeFileAssetsPaths.push(fileToRemove); + } filePaths.push(...fileAssetsPaths); removeFilePaths.push(...removeFileAssetsPaths);