From 2d4e7ad8257aef78f27cda8c92c948f40a8bc49a Mon Sep 17 00:00:00 2001 From: Matthew-Mosior Date: Thu, 25 Jul 2024 14:10:39 -0400 Subject: [PATCH] Adding files to address --clean does not remove the generated docs sub issue of issue 1918. --- src/Idris/Package.idr | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Idris/Package.idr b/src/Idris/Package.idr index 76cf23393..5b51cf544 100644 --- a/src/Idris/Package.idr +++ b/src/Idris/Package.idr @@ -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 ()