Skip to content

Commit

Permalink
Only capture process output when --quiet is used
Browse files Browse the repository at this point in the history
  • Loading branch information
9999years authored and Mikolaj committed Dec 13, 2024
1 parent 2749de9 commit acc21fa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cabal-validate/src/ProcessUtil.hs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ timed opts command args = do
<> setSGR [Reset]

(exitCode, rawStdout, rawStderr) <-
if verbosity opts >= Verbose
if verbosity opts > Quiet
then do
exitCode <- runProcess process
pure (exitCode, ByteString.empty, ByteString.empty)
Expand All @@ -81,9 +81,9 @@ timed opts command args = do

case exitCode of
ExitSuccess -> do
-- Output is captured unless `--verbose` is used, so only print it here
-- if `--verbose` _isn't_ used.
when (verbosity opts <= Info) $ do
-- Output is captured when `--quiet` is used, so only print it here
-- if `--quiet` _isn't_ used.
when (verbosity opts > Quiet) $ do
if hiddenLines <= 0
then T.putStrLn output
else
Expand Down

0 comments on commit acc21fa

Please sign in to comment.