diff options
Diffstat (limited to 'lib/update-dependents.js')
-rw-r--r-- | lib/update-dependents.js | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/lib/update-dependents.js b/lib/update-dependents.js index 71c6b7f95..7499ae134 100644 --- a/lib/update-dependents.js +++ b/lib/update-dependents.js @@ -50,23 +50,21 @@ function updateDependents (args, cb) { if (!args.length) return log( "Nothing to update", "update dependents", cb) asyncMap(args, function (arg, cb) { - chain - ( [lifecycle, arg, "preupdatedependents"] - , [updateDepsTo, arg] - , [lifecycle, arg, "updatedependents"] - , [lifecycle, arg, "postupdatedependents"] - , cb - ) - }, function (er) { + lifecycle(arg, "preupdatedependents", function (er) { + if (er) return cb(er) + updateDepsTo(arg, function (er, rmList) { + if (er) return cb(er) + chain + ( [lifecycle, arg, "updatedependents"] + , [lifecycle, arg, "postupdatedependents"] + , function (er) { cb(er, rmList) } + ) + }) + }) + }, function (er, rmList) { if (er) return cb(er) // now they've all been updated, so remove the others. - var rmList = [] - args.forEach(function (arg) { - // if (!arg._others) log(arg); return - arg._others.forEach(function (o) { - rmList.push(arg.name+"@"+o) - }) - }) + log.verbose(rmList.join("\n"), "updateDependents: rm") npm.commands.rm(rmList, cb) }) }) @@ -133,7 +131,7 @@ function updateDepToNew (depName, depVer, pkg, other, cb) { chain ( [ removeDependencyLinks, data, pkg, other ] , [ createDependencyLinks, data, pkg ] - , cb + , function (er) { cb(er, pkg.name+"@"+other) } ) }) } |