mirror of
https://github.com/zhigang1992/npm.git
synced 2026-06-14 09:49:14 +08:00
addPlacedTarball: send package data obj, not name
This commit is contained in:
10
lib/cache/add-local-tarball.js
vendored
10
lib/cache/add-local-tarball.js
vendored
@@ -81,11 +81,13 @@ function addLocalTarball (p, pkgData, shasum, cb_) {
|
||||
})
|
||||
}
|
||||
|
||||
function addPlacedTarball (p, name, shasum, cb) {
|
||||
if (!cb) cb = name, name = ""
|
||||
function addPlacedTarball (p, pkgData, shasum, cb) {
|
||||
assert(pkgData, "should have package data by now")
|
||||
assert(typeof cb === "function", "cb function required")
|
||||
|
||||
getCacheStat(function (er, cs) {
|
||||
if (er) return cb(er)
|
||||
return addPlacedTarball_(p, name, cs.uid, cs.gid, shasum, cb)
|
||||
return addPlacedTarball_(p, pkgData, cs.uid, cs.gid, shasum, cb)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -122,7 +124,7 @@ function addPlacedTarball (p, name, shasum, cb) {
|
||||
// When the tar and shasum streams both finish, make sure that the shasum
|
||||
// matches dist.shasum, and if not, clean up and bail.
|
||||
|
||||
function addPlacedTarball_ (p, name, uid, gid, resolvedSum, cb) {
|
||||
function addPlacedTarball_ (p, pkgData, uid, gid, resolvedSum, cb) {
|
||||
// now we know it's in place already as .cache/name/ver/package.tgz
|
||||
// unpack to .cache/name/ver/package/, read the package.json,
|
||||
// and fire cb with the json data.
|
||||
|
||||
Reference in New Issue
Block a user