From 81c0cc6ef100ab52fffffffa11a2c517c294beb4 Mon Sep 17 00:00:00 2001 From: ekatek Date: Thu, 23 Oct 2014 16:48:20 -0700 Subject: [PATCH] fix output of adding the same package twice if no constraint satisfied --- tools/commands-packages.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/tools/commands-packages.js b/tools/commands-packages.js index 0f7a26c067..4424a4925b 100644 --- a/tools/commands-packages.js +++ b/tools/commands-packages.js @@ -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(