Restore also extraneous so they are accounted in the uninstall command.

This commit is contained in:
André Cruz
2013-05-30 22:38:25 +01:00
parent 26da7d5e81
commit 81e8b0eb18

View File

@@ -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));