From a20bc9c85de67c30d614fc3376dbab68a486a1c5 Mon Sep 17 00:00:00 2001 From: Nicolas Mattia Date: Wed, 27 Nov 2019 14:35:24 +0100 Subject: [PATCH] Use logger in warnIfOutdated --- src/Niv/Sources.hs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Niv/Sources.hs b/src/Niv/Sources.hs index 260f03e..d89212b 100644 --- a/src/Niv/Sources.hs +++ b/src/Niv/Sources.hs @@ -25,7 +25,6 @@ import qualified Data.ByteString.Lazy.Char8 as BL8 import qualified Data.Digest.Pure.MD5 as MD5 import qualified Data.HashMap.Strict as HMS import qualified Data.Text as T -import qualified Data.Text.IO as T import qualified System.Directory as Dir ------------------------------------------------------------------------------- @@ -184,9 +183,9 @@ pathNixSourcesNix = "nix" "sources.nix" warnIfOutdated :: IO () warnIfOutdated = do tryAny (BL8.readFile pathNixSourcesNix) >>= \case - Left e -> T.putStrLn $ T.unlines -- warn with tsay - [ "Could not read " <> T.pack pathNixSourcesNix - , "Error: " <> tshow e + Left e -> tsay $ T.unlines -- warn with tsay + [ T.unwords [ tyellow "WARNING:", "Could not read" , T.pack pathNixSourcesNix ] + , T.unwords [ " ", "(", tshow e, ")" ] ] Right content -> do case md5ToSourcesVersion (T.pack $ show $ MD5.md5 content) of