Comparing version 1.15.0 to 1.15.1
19
index.js
@@ -0,1 +1,2 @@ | ||
var chownr = require('chownr') | ||
var tar = require('tar-stream') | ||
@@ -288,6 +289,10 @@ var pump = require('pump') | ||
stack.push([name, header.mtime]) | ||
return mkdirp(name, {fs: xfs}, stat) | ||
return mkdirfix(name, { | ||
fs: xfs, own: own, uid: header.uid, gid: header.gid | ||
}, stat) | ||
} | ||
mkdirp(path.dirname(name), {fs: xfs}, function (err) { | ||
mkdirfix(path.dirname(name), { | ||
fs: xfs, own: own, uid: header.uid, gid: header.gid | ||
}, function (err) { | ||
if (err) return next(err) | ||
@@ -310,1 +315,11 @@ | ||
} | ||
function mkdirfix (name, opts, cb) { | ||
mkdirp(name, {fs: opts.xfs}, function (err, made) { | ||
if (!err && made && opts.own) { | ||
chownr(made, opts.uid, opts.gid, cb) | ||
} else { | ||
cb(err) | ||
} | ||
}) | ||
} |
{ | ||
"name": "tar-fs", | ||
"version": "1.15.0", | ||
"version": "1.15.1", | ||
"description": "filesystem bindings for tar-stream", | ||
"dependencies": { | ||
"chownr": "^1.0.1", | ||
"mkdirp": "^0.5.0", | ||
@@ -7,0 +8,0 @@ "pump": "^1.0.0", |
@@ -105,4 +105,4 @@ # tar-fs | ||
var extract = tar.extract('./my-directory', { | ||
dmode: 0555, // all dirs and files should be readable | ||
fmode: 0444 | ||
dmode: parseInt(555, 8), // all dirs should be readable | ||
fmode: parseInt(444, 8) // all files should be readable | ||
}) | ||
@@ -113,2 +113,11 @@ ``` | ||
Alternatively you can set `options.readable` and/or `options.writable` to set the dmode and fmode to readable/writable. | ||
``` js | ||
var extract = tar.extract('./my-directory', { | ||
readable: true, // all dirs and files should be readable | ||
writable: true, // all dirs and files should be writable | ||
}) | ||
``` | ||
Set `options.strict` to `false` if you want to ignore errors due to unsupported entry types (like device files) | ||
@@ -115,0 +124,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21023
439
144
4
+ Addedchownr@^1.0.1
+ Addedchownr@1.1.4(transitive)