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:
Diffstat (limited to 'lib/install/actions.js')
-rw-r--r--lib/install/actions.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/install/actions.js b/lib/install/actions.js
index acd542bbd..23f0c93cb 100644
--- a/lib/install/actions.js
+++ b/lib/install/actions.js
@@ -24,9 +24,9 @@ actions.prepare = require('./action/prepare.js')
actions.finalize = require('./action/finalize.js')
actions.remove = require('./action/remove.js')
actions.move = require('./action/move.js')
-actions['update-linked'] = require('./action/update-linked.js')
actions['global-install'] = require('./action/global-install.js')
actions['global-link'] = require('./action/global-link.js')
+actions['refresh-package-json'] = require('./action/refresh-package-json.js')
// FIXME: We wrap actions like three ways to sunday here.
// Rewrite this to only work one way.
@@ -58,7 +58,9 @@ Object.keys(actions).forEach(function (actionName) {
}
}
function thenRunAction () {
- action(staging, pkg, log, andDone(next))
+ var done = andDone(next)
+ var result = action(staging, pkg, log, done)
+ if (result && result.then) result.then(() => done(), done)
}
function andDone (cb) {
return andFinishTracker(log, andAddParentToErrors(pkg.parent, andHandleOptionalDepErrors(pkg, cb)))
@@ -70,7 +72,7 @@ function markAsFailed (pkg) {
pkg.failed = true
pkg.requires.forEach(function (req) {
req.requiredBy = req.requiredBy.filter(function (reqReqBy) { return reqReqBy !== pkg })
- if (req.requiredBy.length === 0 && !req.userRequired && !req.existing) {
+ if (req.requiredBy.length === 0 && !req.userRequired) {
markAsFailed(req)
}
})