Skip to content

Commit

Permalink
Don not print flags when there is nothing to print
Browse files Browse the repository at this point in the history
  • Loading branch information
harendra-kumar committed Feb 11, 2016
1 parent cee18eb commit 9374353
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Stack/BuildPlan.hs
Original file line number Diff line number Diff line change
Expand Up @@ -785,8 +785,8 @@ showDepErrors :: Map PackageName (Map FlagName Bool) -> DepErrors -> Text
showDepErrors flags errs =
T.concat
[ T.concat $ map formatError (Map.toList errs)
,"User package flags used:\n"
, T.concat (map showFlags userPkgs)
, if T.null flagVals then ""
else ("Using package flags:\n" <> flagVals)
]
where
formatError (depName, DepError mversion neededBy) = T.concat
Expand Down Expand Up @@ -814,6 +814,7 @@ showDepErrors flags errs =
, "\n"
]

flagVals = T.concat (map showFlags userPkgs)
userPkgs = Map.keys $ Map.unions (Map.elems (fmap deNeededBy errs))
showFlags pkg = maybe "" (printFlags pkg) (Map.lookup pkg flags)

Expand Down

0 comments on commit 9374353

Please sign in to comment.