Comparing version 0.1.12 to 0.1.13
@@ -27,2 +27,6 @@ // give it a tarball and a path, and it'll dump the contents | ||
// similar to --strip or --strip-components | ||
opts.strip = +opts.strip | ||
if (!opts.strip || opts.strip <= 0) opts.strip = 0 | ||
this._fst = fstream.Writer(opts) | ||
@@ -37,2 +41,12 @@ | ||
me.on("entry", function (entry) { | ||
// if there's a "strip" argument, then strip off that many | ||
// path components. | ||
if (opts.strip) { | ||
var p = entry.path.split("/").slice(opts.strip).join("/") | ||
entry.path = entry.props.path = p | ||
if (entry.linkpath) { | ||
var lp = entry.linkpath.split("/").slice(opts.strip).join("/") | ||
entry.linkpath = entry.props.linkpath = lp | ||
} | ||
} | ||
if (entry.type !== "Link") return | ||
@@ -39,0 +53,0 @@ entry.linkpath = entry.props.linkpath = |
@@ -5,3 +5,3 @@ { | ||
"description": "tar for node", | ||
"version": "0.1.12", | ||
"version": "0.1.13", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "type": "git", |
143206
4170