From acc21faa7e007585143fac35a9ec3007a96ffccb Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Wed, 20 Nov 2024 15:56:05 -0800 Subject: [PATCH] Only capture process output when `--quiet` is used --- cabal-validate/src/ProcessUtil.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cabal-validate/src/ProcessUtil.hs b/cabal-validate/src/ProcessUtil.hs index 01ea66e2c1a..86c5c16e73f 100644 --- a/cabal-validate/src/ProcessUtil.hs +++ b/cabal-validate/src/ProcessUtil.hs @@ -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) @@ -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