diff --git a/lib/content/put-stream.js b/lib/content/put-stream.js index a460d87..b8504f5 100644 --- a/lib/content/put-stream.js +++ b/lib/content/put-stream.js @@ -133,18 +133,10 @@ function moveToDestination (tmpTarget, cache, digest, opts, errCheck) { return fixOwner.mkdirfix( destDir, opts.uid, opts.gid - ).then(() => ( - new Promise((resolve, reject) => { - errCheck() - moveFile(tmpTarget, destination, err => { - if (err) { - reject(err) - } else { - resolve() - } - }) - }) - )).then(() => { + ).then(() => { + errCheck() + return moveFile(tmpTarget, destination) + }).then(() => { errCheck() return fixOwner.chownr(destination, opts.uid, opts.gid) })