mirror of
https://github.com/revanced/revanced-cli.git
synced 2024-12-05 01:42:54 +01:00
feat: --exclusive
switch (#78)
This commit is contained in:
parent
93a4787780
commit
8e91c12c5e
@ -67,6 +67,9 @@ internal object MainCommand : Runnable {
|
|||||||
@Option(names = ["-e", "--exclude"], description = ["Explicitly exclude patches"])
|
@Option(names = ["-e", "--exclude"], description = ["Explicitly exclude patches"])
|
||||||
var excludedPatches = arrayOf<String>()
|
var excludedPatches = arrayOf<String>()
|
||||||
|
|
||||||
|
@Option(names = ["--exclusive"], description = ["Exclusively include patches"])
|
||||||
|
var defaultExclude = false
|
||||||
|
|
||||||
@Option(names = ["-i", "--include"], description = ["Include patches"])
|
@Option(names = ["-i", "--include"], description = ["Include patches"])
|
||||||
var includedPatches = arrayOf<String>()
|
var includedPatches = arrayOf<String>()
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ internal object Patcher {
|
|||||||
// merge files like necessary integrations
|
// merge files like necessary integrations
|
||||||
patcher.mergeFiles()
|
patcher.mergeFiles()
|
||||||
// add patches, but filter incompatible or excluded patches
|
// add patches, but filter incompatible or excluded patches
|
||||||
patcher.addPatchesFiltered(excludePatches = args.excludedPatches.isNotEmpty())
|
patcher.addPatchesFiltered()
|
||||||
// apply patches
|
// apply patches
|
||||||
patcher.applyPatchesVerbose()
|
patcher.applyPatchesVerbose()
|
||||||
|
|
||||||
|
@ -11,9 +11,7 @@ import app.revanced.patcher.extensions.PatchExtensions.patchName
|
|||||||
import app.revanced.patcher.patch.Patch
|
import app.revanced.patcher.patch.Patch
|
||||||
import app.revanced.patcher.util.patch.implementation.JarPatchBundle
|
import app.revanced.patcher.util.patch.implementation.JarPatchBundle
|
||||||
|
|
||||||
fun Patcher.addPatchesFiltered(
|
fun Patcher.addPatchesFiltered() {
|
||||||
excludePatches: Boolean = false
|
|
||||||
) {
|
|
||||||
val packageName = this.data.packageMetadata.packageName
|
val packageName = this.data.packageMetadata.packageName
|
||||||
val packageVersion = this.data.packageMetadata.packageVersion
|
val packageVersion = this.data.packageMetadata.packageVersion
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user