diff options
author | isaacs <i@izs.me> | 2010-08-26 06:37:50 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2010-08-26 06:37:50 +0400 |
commit | 3031f3fb0732fa20a2a39a5edfc6206454a67fcb (patch) | |
tree | 5f1318cd5b56cbf7501a154969eb25425fd4d25b | |
parent | bef47eea79056166f0a8415d7a2814062ab6663a (diff) |
Let gzip be abstracted out, too.
-rw-r--r-- | lib/cache.js | 4 | ||||
-rw-r--r-- | lib/utils/default-config.js | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/cache.js b/lib/cache.js index b2034a3e6..20c759a9e 100644 --- a/lib/cache.js +++ b/lib/cache.js @@ -211,7 +211,7 @@ function unpackTar (tarball, unpackTarget, cb) { if (er) return log.er(cb, "Could not create "+unpackTarget)(er) // 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]) + pipe( spawn(npm.config.get("gzip"), ["--decompress", "--stdout", tarball]) , spawn( npm.config.get("tar") , ["vx", "--strip-components=1", "-C", unpackTarget] ) @@ -244,7 +244,7 @@ function packTar (targetTarball, folder, cb) { if (include) args.push("-T", include) args.push(addFolder) var tar = spawn(npm.config.get("tar"), args) - , gzip = spawn("gzip", ["--stdout"]) + , gzip = spawn(npm.config.get("gzip"), ["--stdout"]) , errState pipe(tar, gzip, function (er) { if (errState) return diff --git a/lib/utils/default-config.js b/lib/utils/default-config.js index 2320af78f..17d776b1d 100644 --- a/lib/utils/default-config.js +++ b/lib/utils/default-config.js @@ -15,6 +15,7 @@ module.exports = , "update-dependents" : true , "auto-deactivate" : true , "tar" : process.env.TAR || "tar" + , "gzip" : process.env.GZIP || "gzip" , tag : "latest" , root : path.join(process.execPath, "..", "..", "lib", "node") , globalconfig : path.join(process.execPath, "..", "..", "etc", "npmrc") |