Adds using 'rmFile' fn in rmGhcupDirs, it has better windows handling logic

This commit is contained in:
Arjun Kathuria 2021-06-24 10:08:12 +05:30
parent 33eaa765d7
commit 3fae516ce4

View File

@ -1314,7 +1314,8 @@ rmTool ListResult {lVer, lTool, lCross} = do
rmGhcupDirs :: ( MonadReader AppState m rmGhcupDirs :: ( MonadReader AppState m
, MonadIO m , MonadIO m
, MonadLogger m , MonadLogger m
, MonadCatch m ) , MonadCatch m
, MonadMask m )
=> m () => m ()
rmGhcupDirs = do rmGhcupDirs = do
dirs@Dirs dirs@Dirs
@ -1365,7 +1366,7 @@ rmGhcupDirs = do
removeDirIfEmpty logsDir removeDirIfEmpty logsDir
deleteFile filepath = do deleteFile filepath = do
hideError InappropriateType $ liftIO $ removeFile filepath hideError InappropriateType $ rmFile filepath
removeDirIfEmpty filepath = removeDirIfEmpty filepath =
hideError UnsatisfiedConstraints $ liftIO $ removeDirectory filepath hideError UnsatisfiedConstraints $ liftIO $ removeDirectory filepath