Cleanup rmGhcupDirs a bit
This commit is contained in:
parent
b6b24b8e0b
commit
7189998f3b
22
lib/GHCup.hs
22
lib/GHCup.hs
@ -1375,11 +1375,11 @@ rmGhcupDirs = do
|
|||||||
|
|
||||||
rmEnvFile envFilePath
|
rmEnvFile envFilePath
|
||||||
rmConfFile confFilePath
|
rmConfFile confFilePath
|
||||||
rmCacheDir cacheDir
|
rmDir cacheDir
|
||||||
rmLogsDir logsDir
|
rmDir logsDir
|
||||||
rmBinDir binDir
|
rmBinDir binDir
|
||||||
#if defined(IS_WINDOWS)
|
#if defined(IS_WINDOWS)
|
||||||
rmPath (baseDir </> "msys64")
|
rmDir (baseDir </> "msys64")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
liftIO $ removeEmptyDirsRecursive baseDir
|
liftIO $ removeEmptyDirsRecursive baseDir
|
||||||
@ -1400,17 +1400,11 @@ rmGhcupDirs = do
|
|||||||
$logInfo "removing Ghcup Config File"
|
$logInfo "removing Ghcup Config File"
|
||||||
hideError doesNotExistErrorType $ liftIO $ deleteFile confFilePath
|
hideError doesNotExistErrorType $ liftIO $ deleteFile confFilePath
|
||||||
|
|
||||||
rmCacheDir :: (MonadLogger m, MonadIO m) => FilePath -> m ()
|
rmDir :: (MonadLogger m, MonadIO m) => FilePath -> m ()
|
||||||
rmCacheDir cacheDir = do
|
rmDir dir = do
|
||||||
$logInfo "removing ghcup cache Dir"
|
$logInfo [i|removing #{dir}|]
|
||||||
contents <- liftIO $ getDirectoryContentsRecursive cacheDir
|
contents <- liftIO $ getDirectoryContentsRecursive dir
|
||||||
forM_ contents (liftIO . deleteFile . (cacheDir </>))
|
forM_ contents (liftIO . deleteFile . (dir </>))
|
||||||
|
|
||||||
rmLogsDir :: (MonadLogger m, MonadIO m) => FilePath -> m ()
|
|
||||||
rmLogsDir logsDir = do
|
|
||||||
$logInfo "removing ghcup logs Dir"
|
|
||||||
contents <- liftIO $ getDirectoryContentsRecursive logsDir
|
|
||||||
forM_ contents (liftIO . deleteFile . (logsDir </>))
|
|
||||||
|
|
||||||
rmBinDir :: (MonadCatch m, MonadIO m) => FilePath -> m ()
|
rmBinDir :: (MonadCatch m, MonadIO m) => FilePath -> m ()
|
||||||
rmBinDir binDir = do
|
rmBinDir binDir = do
|
||||||
|
Loading…
Reference in New Issue
Block a user