diff --git a/tool/agent-upgrade-dist/src/main/kotlin/Files.kt b/tool/agent-upgrade-dist/src/main/kotlin/Files.kt index db76bee9..759b6457 100644 --- a/tool/agent-upgrade-dist/src/main/kotlin/Files.kt +++ b/tool/agent-upgrade-dist/src/main/kotlin/Files.kt @@ -8,8 +8,8 @@ fun File.dir(): Sequence = this.listFiles()?.asSequence() ?: emptySequence fun File.ensureDirExists(description: String = "", createIfNotExists: Boolean = false): File { if (this.exists()) { - if (this.isDirectory) { - throw Exception("\"$this\" - is not a directory."); + if (!this.isDirectory) { + throw Exception("\"$this\" - is not a directory.") } return Paths.get(path).toRealPath().toFile() }