cacache
Advanced tools
Comparing version 17.1.1 to 17.1.2
@@ -171,14 +171,17 @@ 'use strict' | ||
fs.mkdir(destDir, { recursive: true }) | ||
.then(() => moveFile(tmp.target, destination, { overwrite: false })) | ||
.then(async () => { | ||
await moveFile(tmp.target, destination, { overwrite: false }) | ||
tmp.moved = true | ||
return tmp.moved | ||
}) | ||
.catch(err => { | ||
if (!err.message.startsWith('The destination file exists')) { | ||
throw Object.assign(err, { code: 'EEXIST' }) | ||
} | ||
}).finally(() => { | ||
moveOperations.delete(destination) | ||
}) | ||
) | ||
try { | ||
await moveOperations.get(destination) | ||
tmp.moved = true | ||
} catch (err) { | ||
if (!err.message.startsWith('The destination file exists')) { | ||
throw Object.assign(err, { code: 'EEXIST' }) | ||
} | ||
} finally { | ||
moveOperations.delete(destination) | ||
} | ||
return moveOperations.get(destination) | ||
} | ||
@@ -185,0 +188,0 @@ |
{ | ||
"name": "cacache", | ||
"version": "17.1.1", | ||
"version": "17.1.2", | ||
"cache-version": { | ||
@@ -5,0 +5,0 @@ "content": "2", |
63577
1244