Skip to content

Commit

Permalink
Don't overwrite temporary JOSM preferences when they are already present
Browse files Browse the repository at this point in the history
  • Loading branch information
floscher committed Jun 1, 2018
1 parent db4d9f7 commit 74cc640
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/main/kotlin/task/InitJosmPrefs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}


}
}

0 comments on commit 74cc640

Please sign in to comment.