From 66f6a12aef6d011147714c1b04fae4c641861f67 Mon Sep 17 00:00:00 2001 From: Krystian Panek Date: Sun, 22 Dec 2019 09:46:26 +0100 Subject: [PATCH] Impr --- src/main/kotlin/com/neva/gradle/fork/config/Config.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/com/neva/gradle/fork/config/Config.kt b/src/main/kotlin/com/neva/gradle/fork/config/Config.kt index d455ff8..ebdbf3d 100644 --- a/src/main/kotlin/com/neva/gradle/fork/config/Config.kt +++ b/src/main/kotlin/com/neva/gradle/fork/config/Config.kt @@ -269,8 +269,15 @@ abstract class Config(val fork: ForkExtension, val name: String) { fun removeFile(path: String) = removeFiles(listOf(path)) - fun removeFiles(includes: List, excludes: List = listOf()) { + fun removeFiles(includes: List, excludes: List = listOf(), cleanEmptyDirs: Boolean = true) { eachFiles(includes, excludes, Action { it.remove() }) + if (cleanEmptyDirs) { + removeEmptyDirs() + } + } + + fun removeEmptyDirs() { + action(Action { it.removeEmptyDirs() }) } fun copyTemplateFile(templateName: String) {