diff --git a/src/Cache.ts b/src/Cache.ts index 04f5107f..f0a0794b 100644 --- a/src/Cache.ts +++ b/src/Cache.ts @@ -42,12 +42,7 @@ export class Cache { public async putFileInCache(url: string, currentPath: string, fileName: string): Promise { const cachePath = this.getCachePath(url, fileName); d(`Moving ${currentPath} to ${cachePath}`); - if (await fs.pathExists(cachePath)) { - d('* Replacing existing file'); - await fs.remove(cachePath); - } - - await fs.move(currentPath, cachePath); + await fs.move(currentPath, cachePath, { overwrite: true }); return cachePath; }