aboutsummaryrefslogtreecommitdiff
path: root/haddock-test/src/Test/Haddock.hs
diff options
context:
space:
mode:
Diffstat (limited to 'haddock-test/src/Test/Haddock.hs')
-rw-r--r--haddock-test/src/Test/Haddock.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/haddock-test/src/Test/Haddock.hs b/haddock-test/src/Test/Haddock.hs
index f372f773..942c0587 100644
--- a/haddock-test/src/Test/Haddock.hs
+++ b/haddock-test/src/Test/Haddock.hs
@@ -158,7 +158,9 @@ maybeAcceptFile :: Config c -> FilePath -> CheckResult -> IO CheckResult
maybeAcceptFile cfg file result
| cfgAccept cfg && result `elem` [NoRef, Fail] = do
Just out <- readOut cfg file
- writeFile (refFile dcfg file) $ ccfgDump ccfg out
+ let ref = refFile dcfg file
+ createDirectoryIfMissing True (takeDirectory ref)
+ writeFile ref $ ccfgDump ccfg out
pure Accepted
where
dcfg = cfgDirConfig cfg