From 6c53280b8d723acdff83e6333620b0958f8b600e Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Tue, 16 Aug 2022 12:18:12 +1000 Subject: Moving file writing to inside org backend Also handling odir now --- haddock-api/src/Haddock.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'haddock-api/src/Haddock.hs') diff --git a/haddock-api/src/Haddock.hs b/haddock-api/src/Haddock.hs index 65d329e2..fff8b923 100644 --- a/haddock-api/src/Haddock.hs +++ b/haddock-api/src/Haddock.hs @@ -506,8 +506,9 @@ render logger dflags unit_state flags sinceQual qual ifaces packages extSrcMap = return () when (Flag_Org `elem` flags) $ do withTiming logger dflags' "ppOrg" (const ()) $ do - let org = {-# SCC ppOrg #-} ppOrg title (_doc <$> prologue) (fromJust pkgStr) visibleIfaces - writeUtf8File (fromMaybe "haddock" (cleanPkgStr <$> pkgStr) <.> "org") org + _ <- {-# SCC ppOrg #-} + ppOrg title pkgStr odir (_doc <$> prologue) visibleIfaces + return () when (Flag_HyperlinkedSource `elem` flags && not (null ifaces)) $ do withTiming logger dflags' "ppHyperlinkedSource" (const ()) $ do -- cgit v1.2.3