Skip to content

Commit 9517cd7

Browse files
committed
feat(util): promise-inflight ownership fix requests
1 parent c52c487 commit 9517cd7

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

Diff for: lib/util/fix-owner.js

+8-11
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const Promise = require('bluebird')
44

55
const chownr = Promise.promisify(require('chownr'))
66
const mkdirp = Promise.promisify(require('mkdirp'))
7+
const inflight = require('promise-inflight')
78

89
module.exports.chownr = fixOwner
910
function fixOwner (filepath, uid, gid) {
@@ -20,17 +21,13 @@ function fixOwner (filepath, uid, gid) {
2021
// No need to override if it's already what we used.
2122
return Promise.resolve()
2223
}
23-
// cb = inflight('fixOwner: fixing ownership on ' + filepath, cb)
24-
// if (!cb) {
25-
// // We're inflight! whoosh!
26-
// return
27-
// }
28-
29-
// *now* we override perms
30-
return chownr(
31-
filepath,
32-
typeof uid === 'number' ? uid : process.getuid(),
33-
typeof gid === 'number' ? gid : process.getgid()
24+
return inflight(
25+
'fixOwner: fixing ownership on ' + filepath,
26+
() => chownr(
27+
filepath,
28+
typeof uid === 'number' ? uid : process.getuid(),
29+
typeof gid === 'number' ? gid : process.getgid()
30+
)
3431
)
3532
}
3633

0 commit comments

Comments
 (0)