Skip to content

Commit ba159a3

Browse files
committed
fix: Make the patch command work without specifying any selection
1 parent 74ff940 commit ba159a3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/main/kotlin/app/revanced/cli/command/PatchCommand.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ internal object PatchCommand : Runnable {
3030
private lateinit var spec: CommandSpec
3131

3232
@ArgGroup(multiplicity = "0..*")
33-
private lateinit var selection: Set<Selection>
33+
private var selection = emptySet<Selection>()
3434

3535
internal class Selection {
3636
@ArgGroup(exclusive = false, multiplicity = "1")
@@ -366,14 +366,14 @@ internal object PatchCommand : Runnable {
366366
packageVersion: String,
367367
): Set<Patch<*>> = buildSet {
368368
val enabledPatchesByName =
369-
selection.asSequence().mapNotNull { it.enabled?.selector?.name }.toSet()
369+
selection.mapNotNull { it.enabled?.selector?.name }.toSet()
370370
val enabledPatchesByIndex =
371-
selection.asSequence().mapNotNull { it.enabled?.selector?.index }.toSet()
371+
selection.mapNotNull { it.enabled?.selector?.index }.toSet()
372372

373373
val disabledPatches =
374-
selection.asSequence().mapNotNull { it.disable?.selector?.name }.toSet()
374+
selection.mapNotNull { it.disable?.selector?.name }.toSet()
375375
val disabledPatchesByIndex =
376-
selection.asSequence().mapNotNull { it.disable?.selector?.index }.toSet()
376+
selection.mapNotNull { it.disable?.selector?.index }.toSet()
377377

378378
this@filterPatchSelection.withIndex().forEach patchLoop@{ (i, patch) ->
379379
val patchName = patch.name!!

0 commit comments

Comments
 (0)