Skip to content
Snippets Groups Projects
Verified Commit 7189998f authored by Julian Ospald's avatar Julian Ospald :tea:
Browse files

Cleanup rmGhcupDirs a bit

parent b6b24b8e
No related branches found
No related tags found
No related merge requests found
......@@ -1375,11 +1375,11 @@ rmGhcupDirs = do
rmEnvFile envFilePath
rmConfFile confFilePath
rmCacheDir cacheDir
rmLogsDir logsDir
rmDir cacheDir
rmDir logsDir
rmBinDir binDir
#if defined(IS_WINDOWS)
rmPath (baseDir </> "msys64")
rmDir (baseDir </> "msys64")
#endif
liftIO $ removeEmptyDirsRecursive baseDir
......@@ -1400,17 +1400,11 @@ rmGhcupDirs = do
$logInfo "removing Ghcup Config File"
hideError doesNotExistErrorType $ liftIO $ deleteFile confFilePath
rmCacheDir :: (MonadLogger m, MonadIO m) => FilePath -> m ()
rmCacheDir cacheDir = do
$logInfo "removing ghcup cache Dir"
contents <- liftIO $ getDirectoryContentsRecursive cacheDir
forM_ contents (liftIO . deleteFile . (cacheDir </>))
rmLogsDir :: (MonadLogger m, MonadIO m) => FilePath -> m ()
rmLogsDir logsDir = do
$logInfo "removing ghcup logs Dir"
contents <- liftIO $ getDirectoryContentsRecursive logsDir
forM_ contents (liftIO . deleteFile . (logsDir </>))
rmDir :: (MonadLogger m, MonadIO m) => FilePath -> m ()
rmDir dir = do
$logInfo [i|removing #{dir}|]
contents <- liftIO $ getDirectoryContentsRecursive dir
forM_ contents (liftIO . deleteFile . (dir </>))
rmBinDir :: (MonadCatch m, MonadIO m) => FilePath -> m ()
rmBinDir binDir = do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment