Skip to content

Commit

Permalink
Resolved #781: stack haddock displays index.html paths
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasPK committed Dec 18, 2016
1 parent 9938300 commit 51ab924
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
2 changes: 2 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Other enhancements:
* `stack build` and related commands now allow the user to disable debug symbol stripping
with new `--no-strip`, `--no-library-stripping`, and `--no-executable-shipping` flags,
closing [#877](https://github.com/commercialhaskell/stack/issues/877).
* `stack haddock` now shows index.html paths when documentation is alread up to
date. Resolved [#781](https://github.com/commercialhaskell/stack/issues/781)

Bug fixes:

Expand Down
29 changes: 17 additions & 12 deletions src/Stack/Build/Haddock.hs
Original file line number Diff line number Diff line change
Expand Up @@ -228,18 +228,23 @@ generateHaddockIndex descr envOverride wc hdopts dumpPackages docRelFP destDir =
Left _ -> True
Right indexModTime ->
or [mt > indexModTime | (_,mt,_,_) <- interfaceOpts]
when needUpdate $ do
$logInfo
(T.concat ["Updating Haddock index for ", descr, " in\n",
T.pack (toFilePath destIndexFile)])
liftIO (mapM_ copyPkgDocs interfaceOpts)
readProcessNull
(Just destDir)
envOverride
(haddockExeName wc)
(hoAdditionalArgs hdopts ++
["--gen-contents", "--gen-index"] ++
[x | (xs,_,_,_) <- interfaceOpts, x <- xs])
if needUpdate
then do
$logInfo
(T.concat ["Updating Haddock index for ", descr, " in\n",
T.pack (toFilePath destIndexFile)])
liftIO (mapM_ copyPkgDocs interfaceOpts)
readProcessNull
(Just destDir)
envOverride
(haddockExeName wc)
(hoAdditionalArgs hdopts ++
["--gen-contents", "--gen-index"] ++
[x | (xs,_,_,_) <- interfaceOpts, x <- xs])
else
$logInfo
(T.concat ["Haddock index for ", descr, " already up to date at:\n",
T.pack (toFilePath destIndexFile)])
where
toInterfaceOpt :: DumpPackage a b c -> IO (Maybe ([String], UTCTime, Path Abs File, Path Abs File))
toInterfaceOpt DumpPackage {..} =
Expand Down

0 comments on commit 51ab924

Please sign in to comment.