mirror of
https://github.com/ReVanced/revanced-cli.git
synced 2026-01-17 16:33:58 +00:00
fix: Do not print patch description if null
This commit is contained in:
@@ -85,8 +85,7 @@ internal object ListPatchesCommand : Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun PatchOption<*>.buildString() =
|
fun PatchOption<*>.buildString() = buildString {
|
||||||
buildString {
|
|
||||||
appendLine("Title: $title")
|
appendLine("Title: $title")
|
||||||
description?.let { appendLine("Description: $it") }
|
description?.let { appendLine("Description: $it") }
|
||||||
appendLine("Required: $required")
|
appendLine("Required: $required")
|
||||||
@@ -103,14 +102,13 @@ internal object ListPatchesCommand : Runnable {
|
|||||||
append("\nType: $type")
|
append("\nType: $type")
|
||||||
}
|
}
|
||||||
|
|
||||||
fun IndexedValue<Patch<*>>.buildString() =
|
fun IndexedValue<Patch<*>>.buildString() = let { (index, patch) ->
|
||||||
let { (index, patch) ->
|
|
||||||
buildString {
|
buildString {
|
||||||
if (withIndex) appendLine("Index: $index")
|
if (withIndex) appendLine("Index: $index")
|
||||||
|
|
||||||
append("Name: ${patch.name}")
|
append("Name: ${patch.name}")
|
||||||
|
|
||||||
if (withDescriptions) append("\nDescription: ${patch.description}")
|
if (withDescriptions) patch.description?.let { append("\nDescription: $it") }
|
||||||
|
|
||||||
append("\nEnabled: ${patch.use}")
|
append("\nEnabled: ${patch.use}")
|
||||||
|
|
||||||
@@ -134,8 +132,7 @@ internal object ListPatchesCommand : Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Patch<*>.filterCompatiblePackages(name: String) =
|
fun Patch<*>.filterCompatiblePackages(name: String) = compatiblePackages?.any { (compatiblePackageName, _) -> compatiblePackageName == name }
|
||||||
compatiblePackages?.any { (compatiblePackageName, _) -> compatiblePackageName == name }
|
|
||||||
?: withUniversalPatches
|
?: withUniversalPatches
|
||||||
|
|
||||||
val patches = loadPatchesFromJar(patchesFiles).withIndex().toList()
|
val patches = loadPatchesFromJar(patchesFiles).withIndex().toList()
|
||||||
|
|||||||
Reference in New Issue
Block a user