Skip to content

Commit

Permalink
add fix by @k13-engineering
Browse files Browse the repository at this point in the history
  • Loading branch information
mafintosh committed Nov 6, 2020
1 parent 2b9eb7a commit f80a770
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var statAll = function (fs, stat, cwd, ignore, entries, sort) {
var next = queue.shift()
var nextAbs = path.join(cwd, next)

stat(nextAbs, function (err, stat) {
stat.call(fs, nextAbs, function (err, stat) {
if (err) return callback(err)

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

var mode = (header.mode | (header.type === 'directory' ? dmode : fmode)) & umask
chmod(name, mode, function (err) {

if (chown && own) chown.call(xfs, name, header.uid, header.gid, onchown)
else onchown(null)

function onchown (err) {
if (err) return cb(err)
if (!own) return cb()
if (!chown) return cb()
chown(name, header.uid, header.gid, cb)
})
if (!chmod) return cb()
chmod.call(xfs, name, mode, cb)
}
}

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

0 comments on commit f80a770

Please sign in to comment.