Skip to content

Commit

Permalink
Use removePathForcibly to remove directories
Browse files Browse the repository at this point in the history
  • Loading branch information
carbolymer committed May 10, 2024
1 parent 7a1c4e2 commit 08b77c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Hedgehog/Extras/Test/Base.hs
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ workspace prefixPath f = GHC.withFrozenCallStack $ do
maybeKeepWorkspace <- H.evalIO $ IO.lookupEnv "KEEP_WORKSPACE"
ws <- H.evalIO $ IO.createTempDirectory systemTemp $ prefixPath <> "-test"
H.annotate $ "Workspace: " <> ws
liftIO $ IO.writeFile (ws </> "module") callerModuleName
H.evalIO $ IO.writeFile (ws </> "module") callerModuleName
f ws
when (IO.os /= "mingw32" && maybeKeepWorkspace /= Just "1") $ do
H.evalIO $ IO.removeDirectoryRecursive ws
H.evalIO $ IO.removePathForcibly ws

-- | Create a workspace directory which will exist for at least the duration of
-- the supplied block.
Expand Down

0 comments on commit 08b77c5

Please sign in to comment.