Skip to content

Commit f80a770

Browse files
committed
add fix by @k13-engineering
1 parent 2b9eb7a commit f80a770

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

index.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var statAll = function (fs, stat, cwd, ignore, entries, sort) {
2626
var next = queue.shift()
2727
var nextAbs = path.join(cwd, next)
2828

29-
stat(nextAbs, function (err, stat) {
29+
stat.call(fs, nextAbs, function (err, stat) {
3030
if (err) return callback(err)
3131

3232
if (!stat.isDirectory()) return callback(null, next, stat)
@@ -227,12 +227,15 @@ exports.extract = function (cwd, opts) {
227227
if (!chmod) return cb()
228228

229229
var mode = (header.mode | (header.type === 'directory' ? dmode : fmode)) & umask
230-
chmod(name, mode, function (err) {
230+
231+
if (chown && own) chown.call(xfs, name, header.uid, header.gid, onchown)
232+
else onchown(null)
233+
234+
function onchown (err) {
231235
if (err) return cb(err)
232-
if (!own) return cb()
233-
if (!chown) return cb()
234-
chown(name, header.uid, header.gid, cb)
235-
})
236+
if (!chmod) return cb()
237+
chmod.call(xfs, name, mode, cb)
238+
}
236239
}
237240

238241
extract.on('entry', function (header, stream, next) {

0 commit comments

Comments
 (0)