diff options
author | isaacs <i@izs.me> | 2012-03-13 04:10:13 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2012-03-13 04:10:13 +0400 |
commit | d7ea7d0a6baf618ec48b2dbcfed68345fd744f56 (patch) | |
tree | c9701aa6e8f27bc42e3d895cea2896053d8de4c5 /node_modules/tar | |
parent | 2c05f5c3860180d7829ac507f0b42a59e8e8e5f4 (diff) |
Update tar to 0.1.13
Diffstat (limited to 'node_modules/tar')
-rw-r--r-- | node_modules/tar/lib/extract.js | 14 | ||||
-rw-r--r-- | node_modules/tar/package.json | 24 |
2 files changed, 35 insertions, 3 deletions
diff --git a/node_modules/tar/lib/extract.js b/node_modules/tar/lib/extract.js index e45974c72..c34a81e21 100644 --- a/node_modules/tar/lib/extract.js +++ b/node_modules/tar/lib/extract.js @@ -24,6 +24,10 @@ function Extract (opts) { opts.type = "Directory" opts.Directory = true + // similar to --strip or --strip-components + opts.strip = +opts.strip + if (!opts.strip || opts.strip <= 0) opts.strip = 0 + this._fst = fstream.Writer(opts) this.pause() @@ -33,6 +37,16 @@ function Extract (opts) { // of the tarball. So, they need to be resolved against // the target directory in order to be created properly. 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 entry.linkpath = entry.props.linkpath = path.join(opts.path, path.join("/", entry.props.linkpath)) diff --git a/node_modules/tar/package.json b/node_modules/tar/package.json index aa53022c6..849d0d691 100644 --- a/node_modules/tar/package.json +++ b/node_modules/tar/package.json @@ -1,8 +1,12 @@ { - "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, "name": "tar", "description": "tar for node", - "version": "0.1.12", + "version": "0.1.13", "repository": { "type": "git", "url": "git://github.com/isaacs/node-tar.git" @@ -22,5 +26,19 @@ "devDependencies": { "tap": "0.x", "rimraf": "1.x" - } + }, + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "_id": "tar@0.1.13", + "optionalDependencies": {}, + "_engineSupported": true, + "_npmVersion": "1.1.4", + "_nodeVersion": "v0.7.6-pre", + "_defaultsLoaded": true, + "dist": { + "shasum": "804bdaaacaab928ec1c9bbd8b848a042c3adacb2" + }, + "_from": "tar@0.1.13" } |