diff --git a/src/rollingcache.ts b/src/rollingcache.ts index dee19d0..8553438 100644 --- a/src/rollingcache.ts +++ b/src/rollingcache.ts @@ -98,6 +98,8 @@ export class RollingCache implements ICache this.rolled = true; removeSync(this.oldCacheRoot); - renameSync(this.newCacheRoot, this.oldCacheRoot); + if (existsSync(this.newCacheRoot)) { + renameSync(this.newCacheRoot, this.oldCacheRoot); + } } }