fix output of adding the same package twice if no constraint satisfied

This commit is contained in:
ekatek
2014-10-23 16:48:20 -07:00
committed by Emily Stark
parent 1571194456
commit 81c0cc6ef1

View File

@@ -2149,16 +2149,15 @@ main.registerCommand({
// fail. Rejecting the entire command because a part of it is a no-op is
// confusing.
if (_.has(packages, constraint.name)) {
if (packages[constraint.name] === constraint.constraintString) {
if (constraint.constraintString) {
Console.info(
constraint.name + " with version constraint " +
constraint.constraintString + " has already been added.");
} else {
Console.info(
constraint.name +
" without a version constraint has already been added.");
}
if (!packages[constraint.name] && !constraint.constraintString) {
Console.info(
constraint.name +
" without a version constraint has already been added.");
}
else if (packages[constraint.name] === constraint.constraintString) {
Console.info(
constraint.name + " with version constraint " +
constraint.constraintString + " has already been added.");
} else {
if (packages[constraint.name]) {
Console.info(