Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2010-08-26 06:33:30 +0400
committerisaacs <i@izs.me>2010-08-26 06:33:30 +0400
commit6a98d327001104554600019f2de2802cda972002 (patch)
treea4c50d399fae986d301586d16a887b9be4d9ff5e
parent5d5df9e6e8d668f2edbbc923e51194b196456c0c (diff)
Use a config for "tar", which defaults to the TAR env, or "tar"
-rw-r--r--lib/cache.js6
-rw-r--r--lib/utils/default-config.js1
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/cache.js b/lib/cache.js
index d2e820b98..b2034a3e6 100644
--- a/lib/cache.js
+++ b/lib/cache.js
@@ -212,7 +212,9 @@ function unpackTar (tarball, unpackTarget, cb) {
// cp the gzip of the tarball, pipe the stdout into tar's stdin
// gzip {tarball} --decompress --stdout | tar xf - --strip-components=1 -C {unpackTarget}
pipe( spawn("gzip", ["--decompress", "--stdout", tarball])
- , spawn("tar", ["vxf", "-", "--strip-components=1", "-C", unpackTarget])
+ , spawn( npm.config.get("tar")
+ , ["vx", "--strip-components=1", "-C", unpackTarget]
+ )
, cb
)
})
@@ -241,7 +243,7 @@ function packTar (targetTarball, folder, cb) {
, args = [ "cv", "--exclude", ".git", "-X", ignore]
if (include) args.push("-T", include)
args.push(addFolder)
- var tar = spawn("tar", args)
+ var tar = spawn(npm.config.get("tar"), args)
, gzip = spawn("gzip", ["--stdout"])
, errState
pipe(tar, gzip, function (er) {
diff --git a/lib/utils/default-config.js b/lib/utils/default-config.js
index 241ff3f8f..2320af78f 100644
--- a/lib/utils/default-config.js
+++ b/lib/utils/default-config.js
@@ -14,6 +14,7 @@ module.exports =
{ "auto-activate" : "always"
, "update-dependents" : true
, "auto-deactivate" : true
+ , "tar" : process.env.TAR || "tar"
, tag : "latest"
, root : path.join(process.execPath, "..", "..", "lib", "node")
, globalconfig : path.join(process.execPath, "..", "..", "etc", "npmrc")