There are several instances of code like this:
deletePackageDB :: FilePath -> IO ()
deletePackageDB dbPath = do
-- currently one impl for all compiler flavours, but could change if needed
dir_exists <- doesDirectoryExist dbPath
if dir_exists
then removeDirectoryRecursive dbPath
else do
file_exists <- doesFileExist dbPath
when file_exists $ removeFile dbPath
This is very excessive, a single removePathForcibly would do the trick.
There are several instances of code like this:
This is very excessive, a single
removePathForciblywould do the trick.