Adding files to address --clean does not remove the generated docs sub issue of issue 1918.

This commit is contained in:
Matthew-Mosior 2024-07-25 14:10:39 -04:00
parent 91d0eb3e31
commit 2d4e7ad825

View File

@ -843,6 +843,21 @@ 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
defs <- get Ctxt
let build = build_dir (dirs (options defs))
let docBase = build </> "docs"
let docDir = docBase </> "docs"
Right docfiles' <- coreLift $ listDir docDir
| Left err => pure ()
Right docfiles'' <- coreLift $ listDir docBase
| Left err => pure ()
traverse_ (\x => delete $ docDir </> x)
docfiles'
traverse_ (\x => delete $ docBase </> x)
docfiles''
deleteFolder docDir []
deleteFolder docBase []
runScript (postclean pkg)
where
delete : String -> Core ()