Skip to content

Commit 1d36013

Browse files
committed
fix(put-stream): use new promise API for moves
1 parent 5cf4616 commit 1d36013

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

Diff for: lib/content/put-stream.js

+4-12
Original file line numberDiff line numberDiff line change
@@ -133,18 +133,10 @@ function moveToDestination (tmpTarget, cache, digest, opts, errCheck) {
133133

134134
return fixOwner.mkdirfix(
135135
destDir, opts.uid, opts.gid
136-
).then(() => (
137-
new Promise((resolve, reject) => {
138-
errCheck()
139-
moveFile(tmpTarget, destination, err => {
140-
if (err) {
141-
reject(err)
142-
} else {
143-
resolve()
144-
}
145-
})
146-
})
147-
)).then(() => {
136+
).then(() => {
137+
errCheck()
138+
return moveFile(tmpTarget, destination)
139+
}).then(() => {
148140
errCheck()
149141
return fixOwner.chownr(destination, opts.uid, opts.gid)
150142
})

0 commit comments

Comments
 (0)