feat: make lake clean clean all packages

Fixes leanprover/lake#155
This commit is contained in:
Gabriel Ebner 2023-03-11 01:28:14 +00:00 committed by Mac
parent 57fea2d8e3
commit 620587fc42
2 changed files with 7 additions and 1 deletions

View file

@ -296,7 +296,7 @@ protected def printPaths : CliM PUnit := do
protected def clean : CliM PUnit := do
processOptions lakeOption
let config ← mkLoadConfig (← getThe LakeOptions)
noArgsRem do (← loadWorkspace config).root.clean
noArgsRem do (← loadWorkspace config).clean
protected def script : CliM PUnit := do
if let some cmd ← takeArg? then

View file

@ -178,3 +178,9 @@ def augmentedEnvVars (self : Workspace) : Array (String × Option String) :=
("LEAN_SRC_PATH", some self.augmentedLeanSrcPath.toString),
(sharedLibPathEnvVar, some self.augmentedSharedLibPath.toString)
]
/-- Remove all packages' build outputs (i.e., delete their build directories). -/
def clean (self : Workspace) : IO Unit := do
for (_, pkg) in self.packageMap do
pkg.clean
self.root.clean