fix: only call removeDirAll if path exists

This commit is contained in:
tydeu 2021-09-30 15:50:22 -04:00
parent 3abf53d196
commit 628e5e2818

View file

@ -20,8 +20,9 @@ def Package.run (script : String) (args : List String) (self : Package) : IO PUn
else
self.scripts.forM fun name _ => IO.println name
def Package.clean (self : Package) : IO PUnit :=
IO.FS.removeDirAll self.buildDir
def Package.clean (self : Package) : IO PUnit := do
if (← self.buildDir.pathExists) then
IO.FS.removeDirAll self.buildDir
-- # CLI