diff --git a/src/main/kotlin/com/google/androidstudiopoet/writers/AbstractWriter.kt b/src/main/kotlin/com/google/androidstudiopoet/writers/AbstractWriter.kt index 001a1bab..b2ccc0e9 100644 --- a/src/main/kotlin/com/google/androidstudiopoet/writers/AbstractWriter.kt +++ b/src/main/kotlin/com/google/androidstudiopoet/writers/AbstractWriter.kt @@ -1,5 +1,6 @@ package com.google.androidstudiopoet.writers +import org.apache.commons.io.FileUtils import java.io.File interface AbstractWriter { @@ -14,7 +15,9 @@ interface AbstractWriter { fun delete(path: String) { val file = File(path) - file.listFiles()?.forEach { delete(it.absolutePath) } + if (!FileUtils.isSymlink(file)) { + file.listFiles()?.forEach { delete(it.absolutePath) } + } file.delete() } } \ No newline at end of file