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:
authorRebecca Turner <me@re-becca.org>2015-06-26 07:47:38 +0300
committerRebecca Turner <me@re-becca.org>2015-07-01 14:05:25 +0300
commit92f8474a1c010762eba4a62c3c545d9e0c382321 (patch)
treeb5f882ec8bc0db63dd11497d653bca043b4b18b2
parent0030ade56d32aaec948b0c6310718974210a8c58 (diff)
Revert "install: Make shrinkwrap extraction work in 0.8"
This reverts commit bc46ca9e1c01ad6fcd55e55907dd8ea2991a3ff6.
-rw-r--r--lib/fetch-package-metadata.js17
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/fetch-package-metadata.js b/lib/fetch-package-metadata.js
index 049dfb25f..6c41bfdf0 100644
--- a/lib/fetch-package-metadata.js
+++ b/lib/fetch-package-metadata.js
@@ -252,11 +252,6 @@ function hasTarHeader (c) {
c[264] === 0x00))
}
-function dispose (stream) {
- if (stream.destroy) return stream.destroy()
- if (stream.close) return stream.close()
-}
-
function untarStream (tarball, cb) {
validate('SF', arguments)
cb = once(cb)
@@ -275,7 +270,7 @@ function untarStream (tarball, cb) {
} else if (hasTarHeader(c)) {
doUntar()
} else {
- dispose(file)
+ file.close()
var er = new Error('Non-gzip/tarball ' + tarball)
er.code = 'ENOTTARBALL'
return cb(er)
@@ -292,7 +287,7 @@ function untarStream (tarball, cb) {
er.code = 'EGUNZIP'
cb(er)
})
- tounpipe.push(gunzip)
+ tounpipe.push([stream, gunzip])
stream = gunzip
doUntar()
}
@@ -304,16 +299,18 @@ function untarStream (tarball, cb) {
er.code = 'EUNTAR'
cb(er)
})
- tounpipe.push(untar)
+ tounpipe.push([stream, untar])
stream = untar
addClose()
}
function addClose () {
stream.close = function () {
- tounpipe.forEach(dispose)
+ tounpipe.forEach(function (streams) {
+ streams[0].unpipe(streams[1])
+ })
- dispose(file)
+ file.close()
}
}
}