From 74cc640063d26329c31ecaa808c1dbbfef015572 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Sch=C3=A4fer?= Date: Fri, 1 Jun 2018 20:42:40 +0200 Subject: [PATCH] Don't overwrite temporary JOSM preferences when they are already present --- src/main/kotlin/task/InitJosmPrefs.kt | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main/kotlin/task/InitJosmPrefs.kt b/src/main/kotlin/task/InitJosmPrefs.kt index 2a13789a..6e86d637 100644 --- a/src/main/kotlin/task/InitJosmPrefs.kt +++ b/src/main/kotlin/task/InitJosmPrefs.kt @@ -23,14 +23,16 @@ open class InitJosmPrefs: Copy() { if (source.isEmpty) { logger.debug("No default JOSM preference file found in ${project.extensions.josm.josmConfigDir}/preferences.xml.") } - } - - doFirst { - if (File(destinationDir, PREF_FILE_NAME).exists()) { - logger.lifecycle("JOSM preferences not copied, file is already present.\nIf you want to replace it, run the task 'cleanJosm' additionally.") - } else { - logger.lifecycle("Copy [{}] to {}…", source.files.map { it.absolutePath }.joinToString(", "), destinationDir.absolutePath) + doFirst { + if (File(destinationDir, PREF_FILE_NAME).exists()) { + exclude("*") + logger.lifecycle("Default JOSM preferences not copied, file is already present. If you want to replace it, run the task 'cleanJosm' additionally.") + } else { + logger.lifecycle("Copy [{}] to {}…", source.files.map { it.absolutePath }.joinToString(", "), destinationDir.absolutePath) + } } } + + } }