mirror of
https://github.com/revanced/revanced-patcher.git
synced 2025-05-23 18:37:18 +02:00
add: optional callback for CLI
This commit is contained in:
parent
72f3cad3f9
commit
5b28523eea
@ -100,9 +100,10 @@ class Patcher(
|
||||
* Apply patches loaded into the patcher.
|
||||
* @param stopOnError If true, the patches will stop on the first error.
|
||||
*/
|
||||
fun applyPatches(stopOnError: Boolean = false): Map<String, Result<PatchResult>> {
|
||||
fun applyPatches(stopOnError: Boolean = false, callback: (String) -> Unit = {}): Map<String, Result<PatchResult>> {
|
||||
return buildMap {
|
||||
for (patch in patches) {
|
||||
callback(patch.patchName)
|
||||
val result: Result<PatchResult> = try {
|
||||
val pr = patch.execute(cache)
|
||||
if (pr.isSuccess()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user