Don't error on non-empty dirs during cleanup

This commit is contained in:
Julian Ospald 2023-07-17 23:11:59 +08:00
parent d551cc8077
commit 09d72e7c97
No known key found for this signature in database
GPG Key ID: CCC85C0E40C06A8C

View File

@ -731,7 +731,7 @@ rmGHCVer ver = do
Just files -> do
lift $ logInfo $ "Removing files safely from: " <> T.pack dir
forM_ files (lift . hideError NoSuchThing . recycleFile . (\f -> dir </> dropDrive f))
removeEmptyDirsRecursive dir
hideError UnsatisfiedConstraints $ removeEmptyDirsRecursive dir
survivors <- liftIO $ hideErrorDef [doesNotExistErrorType] [] $ listDirectory dir
f <- recordedInstallationFile GHC ver
lift $ recycleFile f