Do not install if there is a conflict.

This commit is contained in:
André Cruz
2012-10-18 20:41:01 +01:00
parent 712953e799
commit f335f5f1fb

View File

@@ -42,7 +42,8 @@ Manager.prototype.constructor = Manager;
Manager.prototype.resolve = function () {
var resolved = function () {
this.prune();
// If there is an error while pruning (conflict, abort installation)
if (!this.prune()) return this.emit('resolve');
this.on('install', this.emit.bind(this, 'resolve'));
this.install();
}.bind(this);
@@ -142,8 +143,9 @@ Manager.prototype.prune = function () {
this.dependencies = prune(this.getDeepDependencies());
} catch (err) {
this.emit('error', err);
return false;
}
return this;
return true;
};
Manager.prototype.install = function () {