mirror of
https://github.com/revanced/revanced-cli.git
synced 2025-04-29 22:24:36 +02:00
fix: Make the patch command work without specifying any selection
This commit is contained in:
parent
74ff94037e
commit
ba159a35a9
@ -30,7 +30,7 @@ internal object PatchCommand : Runnable {
|
|||||||
private lateinit var spec: CommandSpec
|
private lateinit var spec: CommandSpec
|
||||||
|
|
||||||
@ArgGroup(multiplicity = "0..*")
|
@ArgGroup(multiplicity = "0..*")
|
||||||
private lateinit var selection: Set<Selection>
|
private var selection = emptySet<Selection>()
|
||||||
|
|
||||||
internal class Selection {
|
internal class Selection {
|
||||||
@ArgGroup(exclusive = false, multiplicity = "1")
|
@ArgGroup(exclusive = false, multiplicity = "1")
|
||||||
@ -366,14 +366,14 @@ internal object PatchCommand : Runnable {
|
|||||||
packageVersion: String,
|
packageVersion: String,
|
||||||
): Set<Patch<*>> = buildSet {
|
): Set<Patch<*>> = buildSet {
|
||||||
val enabledPatchesByName =
|
val enabledPatchesByName =
|
||||||
selection.asSequence().mapNotNull { it.enabled?.selector?.name }.toSet()
|
selection.mapNotNull { it.enabled?.selector?.name }.toSet()
|
||||||
val enabledPatchesByIndex =
|
val enabledPatchesByIndex =
|
||||||
selection.asSequence().mapNotNull { it.enabled?.selector?.index }.toSet()
|
selection.mapNotNull { it.enabled?.selector?.index }.toSet()
|
||||||
|
|
||||||
val disabledPatches =
|
val disabledPatches =
|
||||||
selection.asSequence().mapNotNull { it.disable?.selector?.name }.toSet()
|
selection.mapNotNull { it.disable?.selector?.name }.toSet()
|
||||||
val disabledPatchesByIndex =
|
val disabledPatchesByIndex =
|
||||||
selection.asSequence().mapNotNull { it.disable?.selector?.index }.toSet()
|
selection.mapNotNull { it.disable?.selector?.index }.toSet()
|
||||||
|
|
||||||
this@filterPatchSelection.withIndex().forEach patchLoop@{ (i, patch) ->
|
this@filterPatchSelection.withIndex().forEach patchLoop@{ (i, patch) ->
|
||||||
val patchName = patch.name!!
|
val patchName = patch.name!!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user