diff --git a/aura/exec/aura.hs b/aura/exec/aura.hs index fe5278cb5..f3b8e9308 100644 --- a/aura/exec/aura.hs +++ b/aura/exec/aura.hs @@ -82,7 +82,7 @@ execute env p = first f <$> try (runRIO env . execOpts $ _operation p) f (Failure fl) = fl $ langOf (settings env) exit :: Settings -> Either (Doc AnsiStyle) () -> IO a -exit ss (Left e) = scold ss e *> exitFailure +exit ss (Left e) = scold ss (const e) *> exitFailure exit _ (Right _) = exitSuccess execOpts :: Either (PacmanOp, Set MiscOp) AuraOp -> RIO Env () diff --git a/aura/lib/Aura/Build.hs b/aura/lib/Aura/Build.hs index 7d9fbdcb4..7154f3d33 100644 --- a/aura/lib/Aura/Build.hs +++ b/aura/lib/Aura/Build.hs @@ -118,7 +118,7 @@ overwritePkgbuild ss p = when (switch ss HotEdit || switch ss UseCustomizepkg) $ buildFail :: Failure -> RIO Env (Maybe a) buildFail (Failure err) = do ss <- asks settings - liftIO . scold ss . err $ langOf ss + scold ss err withOkay ss buildFail_6 buildFail_5 $ pure Nothing -- | Moves a file to the pacman package cache and returns its location. diff --git a/aura/lib/Aura/Core.hs b/aura/lib/Aura/Core.hs index 973e080a2..f270b0a06 100644 --- a/aura/lib/Aura/Core.hs +++ b/aura/lib/Aura/Core.hs @@ -190,8 +190,8 @@ warn :: MonadIO m => Settings -> (Language -> Doc AnsiStyle) -> m () warn ss msg = putStrLnA ss $ yellow (msg $ langOf ss) -- | Print some message in red with Aura flair. -scold :: Settings -> Doc AnsiStyle -> IO () -scold ss = putStrLnA ss . red +scold :: MonadIO m => Settings -> (Language -> Doc AnsiStyle) -> m () +scold ss msg = putStrLnA ss $ red (msg $ langOf ss) -- | Report a message with multiple associated items. Usually a list of -- naughty packages. diff --git a/aura/lib/Aura/Install.hs b/aura/lib/Aura/Install.hs index 3f4ebef79..e0ed4c75a 100644 --- a/aura/lib/Aura/Install.hs +++ b/aura/lib/Aura/Install.hs @@ -112,7 +112,7 @@ analysePkgbuild b = do Just l -> case bannedTerms l of [] -> pure () bts -> do - liftIO $ scold ss (security_5 (bName b) $ langOf ss) + scold ss . security_5 $ bName b liftIO $ traverse_ (displayBannedTerms ss) bts f