Merge pull request #6419 from eed3si9n/wip/clean

Fixes clean not cleaning files added to cleanFiles
This commit is contained in:
eugene yokota 2021-03-29 00:44:53 -04:00 committed by GitHub
commit e31e18927c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 4 deletions

View File

@ -93,8 +93,9 @@ private[sbt] object Clean {
val targetDir = (scope / target).?.value.map(_.toPath)
targetDir.filter(_ => full).foreach(deleteContents(_, excludeFilter, view, delete))
(scope / cleanFiles).?.value.getOrElse(Nil).foreach { f =>
deleteContents(f.toPath, excludeFilter, view, delete)
(scope / cleanFiles).?.value.getOrElse(Nil).foreach { x =>
if (x.isDirectory) deleteContents(x.toPath, excludeFilter, view, delete)
else delete(x.toPath)
}
// This is the special portion of the task where we clear out the relevant streams

View File

@ -1 +1,2 @@
cleanFiles += baseDirectory.value / "foo"
cleanFiles += baseDirectory.value / "foo"
cleanFiles += baseDirectory.value / "a.txt"

View File

@ -1,3 +1,4 @@
> clean
$ absent foo/bar/baz.txt
$ absent foo/bar/baz.txt
$ absent a.txt