fix: Error: EEXIST: file already exists

This commit is contained in:
igorklopov 2016-08-16 20:23:02 +04:00
parent 9f56a367a1
commit 307ebd314c

View File

@ -43,6 +43,7 @@ export async function download (remote, local) {
const tempFile = local + '.downloading';
await mkdirp(path.dirname(tempFile));
await downloadAsset(asset, tempFile);
await remove(local);
await moveFile(tempFile, local);
await remove(tempFile);
return true;