From 81e8b0eb187bf05e94c075abc4de92d2ec209f3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20Cruz?= Date: Thu, 30 May 2013 22:38:25 +0100 Subject: [PATCH] Restore also extraneous so they are accounted in the uninstall command. --- lib/core/Project.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/core/Project.js b/lib/core/Project.js index 6168424f..fef8b976 100644 --- a/lib/core/Project.js +++ b/lib/core/Project.js @@ -242,7 +242,7 @@ Project.prototype.uninstall = function (names, options) { // Otherwise we need to figure it out if the user really wants to remove it, // even with dependants } else { - message = dependants.map(function (dep) { return dep.name; }).join(', ') + ' depend on ' + decEndpoint.name; + message = dependants.map(function (dep) { return dep.name; }).join(', ') + ' depends on ' + decEndpoint.name; data = { package: decEndpoint.name, dependants: dependants.map(function (decEndpoint) { @@ -324,8 +324,15 @@ Project.prototype.analyse = function () { mout.object.forOwn(flattened, function (decEndpoint) { if (!decEndpoint.dependants) { decEndpoint.extraneous = true; + + // Restore them + this._restoreNode(decEndpoint, flattened); + // Do the same for the dev dependencies + if (!this._production) { + this._restoreNode(decEndpoint, flattened, 'devDependencies'); + } } - }); + }, this); return [json, root, flattened]; }.bind(this));