fix: don't try to rename folder after exception

This commit is contained in:
Zoltan Kochan
2018-02-03 15:25:46 +02:00
parent 1d062440ff
commit 402ef08edd

View File

@@ -166,6 +166,10 @@ export default (
}),
waitTillClosed({ stream, size, getDownloaded: () => downloaded, url }),
])
.then((vals) => {
return renameOverwrite(stage, opts.unpackTo)
.then(() => resolve(vals[1]))
})
.catch((err) => {
rimraf(stage, (err) => {
// Just ignoring this error
@@ -173,10 +177,6 @@ export default (
})
reject(err)
})
.then((vals) => {
return renameOverwrite(stage, opts.unpackTo)
.then(() => resolve(vals[1]))
})
})
} catch (err) {
err.attempts = currentAttempt