diff options
author | Kat Marchán <kzm@sykosomatic.org> | 2016-09-22 07:59:37 -0700 |
---|---|---|
committer | Jeremiah Senkpiel <fishrock123@rocketmail.com> | 2016-09-27 16:39:27 -0400 |
commit | d44a9eb11b34900b44a9d135a2c965346fff702e (patch) | |
tree | a8d074826fb51641f5a7f24978e5e632b958ca84 /deps/npm/lib/cache/add-local.js | |
parent | 33aa953f918f624a44e538baf2a3ee41570ac303 (diff) | |
download | node-new-d44a9eb11b34900b44a9d135a2c965346fff702e.tar.gz |
deps: upgrade npm to 3.10.8
PR-URL: https://github.com/nodejs/node/pull/8706
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Diffstat (limited to 'deps/npm/lib/cache/add-local.js')
-rw-r--r-- | deps/npm/lib/cache/add-local.js | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/deps/npm/lib/cache/add-local.js b/deps/npm/lib/cache/add-local.js index 075ca5fc61..0794b92144 100644 --- a/deps/npm/lib/cache/add-local.js +++ b/deps/npm/lib/cache/add-local.js @@ -20,7 +20,7 @@ module.exports = addLocal function addLocal (p, pkgData, cb_) { assert(typeof p === 'object', 'must have spec info') - assert(typeof cb === 'function', 'must have callback') + assert(typeof cb_ === 'function', 'must have callback') pkgData = pkgData || {} @@ -91,10 +91,10 @@ function addLocalDirectory (p, pkgData, shasum, cb) { getCacheStat(function (er, cs) { mkdir(path.dirname(pj), function (er, made) { - if (er) return cb(er) + if (er) return wrapped(er) var doPrePublish = !pathIsInside(p, npm.tmp) if (doPrePublish) { - lifecycle(data, 'prepublish', p, iferr(cb, thenPack)) + lifecycle(data, 'prepublish', p, iferr(wrapped, thenPack)) } else { thenPack() } @@ -102,12 +102,15 @@ function addLocalDirectory (p, pkgData, shasum, cb) { tar.pack(tgz, p, data, function (er) { if (er) { log.error('addLocalDirectory', 'Could not pack', p, 'to', tgz) - return cb(er) + return wrapped(er) } - if (!cs || isNaN(cs.uid) || isNaN(cs.gid)) wrapped() + if (!cs || isNaN(cs.uid) || isNaN(cs.gid)) return wrapped() - chownr(made || tgz, cs.uid, cs.gid, wrapped) + chownr(made || tgz, cs.uid, cs.gid, function (er) { + if (er && er.code === 'ENOENT') return wrapped() + wrapped(er) + }) }) } }) |