From ba159a35a9a99d18a4c1e04128b08ae336a49b3e Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Thu, 5 Sep 2024 22:54:09 +0400 Subject: [PATCH] fix: Make the patch command work without specifying any selection --- .../kotlin/app/revanced/cli/command/PatchCommand.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/app/revanced/cli/command/PatchCommand.kt b/src/main/kotlin/app/revanced/cli/command/PatchCommand.kt index a179fc9..4a0df0d 100644 --- a/src/main/kotlin/app/revanced/cli/command/PatchCommand.kt +++ b/src/main/kotlin/app/revanced/cli/command/PatchCommand.kt @@ -30,7 +30,7 @@ internal object PatchCommand : Runnable { private lateinit var spec: CommandSpec @ArgGroup(multiplicity = "0..*") - private lateinit var selection: Set + private var selection = emptySet() internal class Selection { @ArgGroup(exclusive = false, multiplicity = "1") @@ -366,14 +366,14 @@ internal object PatchCommand : Runnable { packageVersion: String, ): Set> = buildSet { val enabledPatchesByName = - selection.asSequence().mapNotNull { it.enabled?.selector?.name }.toSet() + selection.mapNotNull { it.enabled?.selector?.name }.toSet() val enabledPatchesByIndex = - selection.asSequence().mapNotNull { it.enabled?.selector?.index }.toSet() + selection.mapNotNull { it.enabled?.selector?.index }.toSet() val disabledPatches = - selection.asSequence().mapNotNull { it.disable?.selector?.name }.toSet() + selection.mapNotNull { it.disable?.selector?.name }.toSet() val disabledPatchesByIndex = - selection.asSequence().mapNotNull { it.disable?.selector?.index }.toSet() + selection.mapNotNull { it.disable?.selector?.index }.toSet() this@filterPatchSelection.withIndex().forEach patchLoop@{ (i, patch) -> val patchName = patch.name!!