From d551cc807754b3e265ff84db6dfdb6c034ecc8b3 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Mon, 17 Jul 2023 23:10:43 +0800 Subject: [PATCH] Better logging for cross removal --- lib/GHCup.hs | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/lib/GHCup.hs b/lib/GHCup.hs index 443f3c5..74c55e8 100644 --- a/lib/GHCup.hs +++ b/lib/GHCup.hs @@ -134,15 +134,24 @@ rmTool :: ( MonadReader env m => ListResult -> Excepts '[NotInstalled, UninstallFailed] m () rmTool ListResult {lVer, lTool, lCross} = do - logInfo $ "removing " <> T.pack (show lTool) <> " version " <> prettyVer lVer + let printRmTool = logInfo $ "removing " <> T.pack (show lTool) <> " version " <> prettyVer lVer case lTool of - GHC -> + GHC -> do let ghcTargetVersion = GHCTargetVersion lCross lVer - in rmGHCVer ghcTargetVersion - HLS -> rmHLSVer lVer - Cabal -> liftE $ rmCabalVer lVer - Stack -> liftE $ rmStackVer lVer - GHCup -> lift rmGhcup + logInfo $ "removing " <> T.pack (show lTool) <> " version " <> tVerToText ghcTargetVersion + rmGHCVer ghcTargetVersion + HLS -> do + printRmTool + rmHLSVer lVer + Cabal -> do + printRmTool + liftE $ rmCabalVer lVer + Stack -> do + printRmTool + liftE $ rmStackVer lVer + GHCup -> do + printRmTool + lift rmGhcup rmGhcupDirs :: ( MonadReader env m