mirror of https://github.com/sbt/sbt.git
Fixes clean not cleaning files added to cleanFiles
Fixes #6395 The current code assumes cleanFiles are only directories. This fixes that.
This commit is contained in:
parent
1cb23c843b
commit
2a3a0f5594
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1 +1,2 @@
|
|||
cleanFiles += baseDirectory.value / "foo"
|
||||
cleanFiles += baseDirectory.value / "foo"
|
||||
cleanFiles += baseDirectory.value / "a.txt"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
> clean
|
||||
|
||||
$ absent foo/bar/baz.txt
|
||||
$ absent foo/bar/baz.txt
|
||||
$ absent a.txt
|
||||
|
|
|
|||
Loading…
Reference in New Issue