From 5741e069ad5cbf6599dc70d5b9ab9c2a95be927f Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Fri, 20 May 2022 23:28:15 +0200 Subject: [PATCH] Fix deletion on missing files --- lib/GHCup.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/GHCup.hs b/lib/GHCup.hs index 3e4e0c3..2d09ab7 100644 --- a/lib/GHCup.hs +++ b/lib/GHCup.hs @@ -1808,7 +1808,7 @@ rmGHCVer ver = do lift (getInstalledFiles GHC ver) >>= \case Just files -> do lift $ logInfo $ "Removing files safely from: " <> T.pack dir - forM_ files (lift . recycleFile . (\f -> dir dropDrive f)) + forM_ files (lift . hideError NoSuchThing . recycleFile . (\f -> dir dropDrive f)) removeEmptyDirsRecursive dir survivors <- liftIO $ hideErrorDef [doesNotExistErrorType] [] $ listDirectory dir f <- recordedInstallationFile GHC ver @@ -1892,7 +1892,7 @@ rmHLSVer ver = do lift (getInstalledFiles HLS (mkTVer ver)) >>= \case Just files -> do lift $ logInfo $ "Removing files safely from: " <> T.pack hlsDir - forM_ files (lift . recycleFile . (\f -> hlsDir dropDrive f)) + forM_ files (lift . hideError NoSuchThing . recycleFile . (\f -> hlsDir dropDrive f)) removeEmptyDirsRecursive hlsDir survivors <- liftIO $ hideErrorDef [doesNotExistErrorType] [] $ listDirectory hlsDir f <- recordedInstallationFile HLS (mkTVer ver)