From 0ca084cf868f316bd12eec044774ac5e8e1afa34 Mon Sep 17 00:00:00 2001 From: Bruno Hensel Date: Fri, 4 Oct 2024 11:29:40 +0200 Subject: [PATCH] Prevent adding empty/blank `compilerFlags` to a command --- .../dev/romainguy/kotlin/explorer/build/KolinCompiler.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/jvmMain/kotlin/dev/romainguy/kotlin/explorer/build/KolinCompiler.kt b/src/jvmMain/kotlin/dev/romainguy/kotlin/explorer/build/KolinCompiler.kt index 7d7b0d49..1028b181 100644 --- a/src/jvmMain/kotlin/dev/romainguy/kotlin/explorer/build/KolinCompiler.kt +++ b/src/jvmMain/kotlin/dev/romainguy/kotlin/explorer/build/KolinCompiler.kt @@ -36,8 +36,10 @@ class KotlinCompiler(private val toolPaths: ToolPaths, private val outputDirecto file.toString(), file.parent.resolve("Keep.kt").toString() ).apply { - // TODO: Do something smarter in case a flag looks like -foo="something with space" - addAll(compilerFlags.split(' ')) + if (compilerFlags.isNotEmpty() || compilerFlags.isNotBlank()) { + // TODO: Do something smarter in case a flag looks like -foo="something with space" + addAll(compilerFlags.split(' ')) + } } return command.toTypedArray()