mirror of
https://github.com/revanced/revanced-cli.git
synced 2024-08-25 00:31:50 +02:00
refactor
This commit is contained in:
parent
948757d597
commit
88edb9c474
@ -293,25 +293,23 @@ internal object PatchCommand : Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
// region Patch
|
||||
|
||||
patcher.context.packageMetadata.packageName to patcher.apply {
|
||||
this += filteredPatches to integrations
|
||||
patcher += filteredPatches to integrations
|
||||
|
||||
// Execute patches.
|
||||
runBlocking {
|
||||
execute().collect { patchResult ->
|
||||
patchResult.exception?.let {
|
||||
StringWriter().use { writer ->
|
||||
it.printStackTrace(PrintWriter(writer))
|
||||
logger.severe("\"${patchResult.patch.name}\" failed:\n$writer")
|
||||
}
|
||||
} ?: logger.info("\"${patchResult.patch.name}\" succeeded")
|
||||
}
|
||||
}
|
||||
}.get()
|
||||
patcher().collect { patchResult ->
|
||||
val exception = patchResult.exception
|
||||
?: return@collect logger.info("\"${patchResult.patch}\" succeeded")
|
||||
|
||||
// endregion
|
||||
StringWriter().use { writer ->
|
||||
exception.printStackTrace(PrintWriter(writer))
|
||||
|
||||
logger.severe("\"${patchResult.patch}\" failed:\n$writer")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
patcher.context.packageMetadata.packageName to patcher.get()
|
||||
}
|
||||
|
||||
// region Save
|
||||
|
Loading…
Reference in New Issue
Block a user