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:
-rw-r--r--lib/update-dependents.js9
-rw-r--r--lib/update.js8
2 files changed, 11 insertions, 6 deletions
diff --git a/lib/update-dependents.js b/lib/update-dependents.js
index 095e240ab..73ec4710e 100644
--- a/lib/update-dependents.js
+++ b/lib/update-dependents.js
@@ -34,6 +34,12 @@ function updateDependents (args, cb) {
if (!args.length) return cb() // nothing to do
readArgs(args, function (er, args) {
if (er) return log.er(cb, "Error reading args")(er)
+
+ cb = (function (cb) { return function (er) {
+ var a = args.map(function (a) { return a._id })
+ log( a, (er) ? "failed to update dependents" : "updated dependents")
+ return cb(er)
+ }})(cb)
// now this is an array of package descriptors
// and each one is installed, and has siblings.
// update any dependents on any other versions to this one,
@@ -167,13 +173,10 @@ function createDependencyLinks (dep, pkg, cb) {
function readArgs (args, cb) {
var p = args.length
- log(args, "readArgs before")
function r () { if (--p === 0) {
- log(args, "readArgs after")
cb(null, args.filter(function (a) { return a }))
}}
function readOthers (arg, i) {
- log(arg, "readOthers")
readInstalled([arg.name], function (er, inst) {
log(inst, "installed "+arg.name)
if (er) {
diff --git a/lib/update.js b/lib/update.js
index 27d642afc..682f80b88 100644
--- a/lib/update.js
+++ b/lib/update.js
@@ -49,7 +49,6 @@ function update (args, cb) {
})
}
function installUpdates (updates, cb) {
- log(updates, "install updates")
npm.config.set("auto-update", true)
var installList = []
, updateList = []
@@ -63,6 +62,11 @@ function installUpdates (updates, cb) {
})
log(installList, "update installList")
log(updateList, "update updateList")
+ var fullList = installList.concat(updateList)
+ cb = (function (cb) { return function (er) {
+ log(fullList.join(" "), er ? "failed to update" : "updated")
+ cb(er)
+ }})(cb)
npm.commands.install(installList, function (er) {
if (er) return log.er(cb, "install failed "+installList)(er)
npm.commands["update-dependents"](updateList, function (er) {
@@ -73,10 +77,8 @@ function installUpdates (updates, cb) {
}
function findUpdates (args, cb) {
- log(args, "findUpdates")
readInstalled(args, function (er, inst) {
if (er) return log.er(cb, "Couldn't read installed packages")(er)
- log(inst, "installed")
var pkgs = Object.keys(inst)
, p = pkgs.length
, updates = {}