Better doc.

This commit is contained in:
André Cruz
2013-05-30 22:05:33 +01:00
parent 13aa3914ac
commit a27ad2e353

View File

@@ -196,11 +196,13 @@ Project.prototype.update = function (names, options) {
Project.prototype.uninstall = function (names, options) {
var that = this;
var deferred = Q.defer();
var packages = {};
// Analyse the project
this.analyse()
// Fill in the packages to be uninstalled
.spread(function (json, tree, flattened) {
var promise = Q.resolve();
var packages = [];
names.forEach(function (name) {
var decEndpoint = flattened[name];
@@ -272,13 +274,16 @@ Project.prototype.uninstall = function (names, options) {
});
});
return promise
.then(function () {
return that._removePackages(packages, options)
.progress(deferred.notify);
return promise;
})
// Remove packages
.then(function () {
return that._removePackages(packages, options)
.progress(function (notification) {
return notification;
});
})
.then(deferred.resolve, deferred.reject);
.then(deferred.resolve, deferred.reject, deferred.notify);
return deferred.promise;
};