mirror of
https://github.com/revanced/revanced-cli.git
synced 2024-11-11 22:29:24 +01:00
fix: don't log when package is incompatible and exclusive
option is used
This commit is contained in:
parent
8c2aeff2cf
commit
ad81a1b656
@ -87,7 +87,7 @@ internal object MainCommand : Runnable {
|
||||
names = ["--exclusive"],
|
||||
description = ["Only installs the patches you include, not including any patch by default"]
|
||||
)
|
||||
var defaultExclude = false
|
||||
var exclusive = false
|
||||
|
||||
@Option(names = ["-i", "--include"], description = ["Include patches"])
|
||||
var includedPatches = arrayOf<String>()
|
||||
|
@ -18,18 +18,9 @@ fun Patcher.addPatchesFiltered(allPatches: List<Class<out Patch<Context>>>) {
|
||||
allPatches.forEach patchLoop@{ patch ->
|
||||
val compatiblePackages = patch.compatiblePackages
|
||||
val patchName = patch.patchName
|
||||
|
||||
val prefix = "Skipping $patchName"
|
||||
|
||||
val args = MainCommand.args.patchArgs?.patchingArgs!!
|
||||
|
||||
if (args.excludedPatches.contains(patchName)) {
|
||||
logger.info("$prefix: Manually excluded")
|
||||
return@patchLoop
|
||||
} else if ((!patch.include || args.defaultExclude) && !args.includedPatches.contains(patchName)) {
|
||||
logger.info("$prefix: Excluded by default")
|
||||
return@patchLoop
|
||||
}
|
||||
val prefix = "Skipping $patchName"
|
||||
|
||||
if (compatiblePackages == null) logger.trace("$patchName: No constraint on packages.")
|
||||
else {
|
||||
@ -51,6 +42,14 @@ fun Patcher.addPatchesFiltered(allPatches: List<Class<out Patch<Context>>>) {
|
||||
}
|
||||
}
|
||||
|
||||
if (args.excludedPatches.contains(patchName)) {
|
||||
logger.info("$prefix: Manually excluded")
|
||||
return@patchLoop
|
||||
} else if ((!patch.include || args.exclusive) && !args.includedPatches.contains(patchName)) {
|
||||
logger.info("$prefix: Excluded by default")
|
||||
return@patchLoop
|
||||
}
|
||||
|
||||
logger.trace("Adding $patchName")
|
||||
includedPatches.add(patch)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user