mirror of
https://github.com/ReVanced/revanced-cli.git
synced 2026-01-10 21:36:19 +00:00
fix: Make the patch command work without specifying any selection
This commit is contained in:
@@ -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!!
|
||||||
|
|||||||
Reference in New Issue
Block a user