fix: Do not print patch description if null

This commit is contained in:
oSumAtrIX
2025-04-25 22:26:45 +02:00
parent 1717cc66f7
commit bba90fede8

View File

@@ -85,8 +85,7 @@ internal object ListPatchesCommand : Runnable {
}
}
fun PatchOption<*>.buildString() =
buildString {
fun PatchOption<*>.buildString() = buildString {
appendLine("Title: $title")
description?.let { appendLine("Description: $it") }
appendLine("Required: $required")
@@ -103,14 +102,13 @@ internal object ListPatchesCommand : Runnable {
append("\nType: $type")
}
fun IndexedValue<Patch<*>>.buildString() =
let { (index, patch) ->
fun IndexedValue<Patch<*>>.buildString() = let { (index, patch) ->
buildString {
if (withIndex) appendLine("Index: $index")
append("Name: ${patch.name}")
if (withDescriptions) append("\nDescription: ${patch.description}")
if (withDescriptions) patch.description?.let { append("\nDescription: $it") }
append("\nEnabled: ${patch.use}")
@@ -134,8 +132,7 @@ internal object ListPatchesCommand : Runnable {
}
}
fun Patch<*>.filterCompatiblePackages(name: String) =
compatiblePackages?.any { (compatiblePackageName, _) -> compatiblePackageName == name }
fun Patch<*>.filterCompatiblePackages(name: String) = compatiblePackages?.any { (compatiblePackageName, _) -> compatiblePackageName == name }
?: withUniversalPatches
val patches = loadPatchesFromJar(patchesFiles).withIndex().toList()