Merge pull request #3353 from Matthew-Mosior/clean-does-not-remove-generated-docs

Clean removes generated docs
This commit is contained in:
André Videla 2024-08-06 00:33:42 +01:00 committed by GitHub
commit d9049e82ff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 1 deletions

View File

@ -256,4 +256,5 @@ This CHANGELOG describes the merged but unreleased changes. Please see [CHANGELO
#### Documentation
* Module docstrings are now displayed for namespace indexes when documentation is built via --mkdoc.
* Module docstrings are now displayed for namespace indexes when documentation is built via `--mkdoc`.
* Generated documentation are now removed via `--clean`.

View File

@ -843,6 +843,10 @@ clean pkg opts -- `opts` is not used but might be in the future
deleteFolder builddir []
maybe (pure ()) (\e => delete (outputdir </> e))
(executable pkg)
-- clean out the generated docs
let build = build_dir (dirs (options defs))
deleteDocsFolder $ build </> "docs" </> "docs"
deleteDocsFolder $ build </> "docs"
runScript (postclean pkg)
where
delete : String -> Core ()
@ -859,6 +863,14 @@ clean pkg opts -- `opts` is not used but might be in the future
delete $ ttFile <.> "ttc"
delete $ ttFile <.> "ttm"
deleteDocsFolder : String -> Core ()
deleteDocsFolder dir
= do Right docbasefiles <- coreLift $ listDir dir
| Left err => pure ()
traverse_ (\x => delete $ dir </> x)
docbasefiles
deleteFolder dir []
-- Just load the given module, if it exists, which will involve building
-- it if necessary
runRepl : {auto c : Ref Ctxt Defs} ->