Skip to content

Replace removeDirectoryRecursive with removePathForcibly #11591

@Bodigrim

Description

@Bodigrim

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions