diff --git a/CHANGELOG.md b/CHANGELOG.md index 4364d788..efdabeb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [2.21.4-dev.1](https://github.com/revanced/revanced-cli/compare/v2.21.3...v2.21.4-dev.1) (2023-06-18) + + +### Bug Fixes + +* remove duplicate options entries. ([d0fc886](https://github.com/revanced/revanced-cli/commit/d0fc8864286adc2677f91a319a11a90272c1001d)) + ## [2.21.3](https://github.com/revanced/revanced-cli/compare/v2.21.2...v2.21.3) (2023-06-12) ## [2.21.3-dev.1](https://github.com/revanced/revanced-cli/compare/v2.21.2...v2.21.3-dev.1) (2023-06-07) diff --git a/gradle.properties b/gradle.properties index 47ab8390..087f3dbc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,2 @@ kotlin.code.style = official -version = 2.21.3 +version = 2.21.4-dev.1 diff --git a/src/main/kotlin/app/revanced/utils/Options.kt b/src/main/kotlin/app/revanced/utils/Options.kt index e4302650..4e07d85d 100644 --- a/src/main/kotlin/app/revanced/utils/Options.kt +++ b/src/main/kotlin/app/revanced/utils/Options.kt @@ -5,6 +5,7 @@ import app.revanced.cli.logging.CliLogger import app.revanced.patcher.extensions.PatchExtensions.options import app.revanced.patcher.extensions.PatchExtensions.patchName import app.revanced.patcher.patch.NoSuchOptionException +import app.revanced.utils.Options.PatchOption.Option import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper import java.io.File @@ -25,9 +26,12 @@ internal object Options { .map { patch -> PatchOption( patch.patchName, - patch.options!!.map { option -> PatchOption.Option(option.key, option.value) } + patch.options!!.map { option -> Option(option.key, option.value) } ) - }.let { + } + // See https://github.com/revanced/revanced-patches/pull/2434/commits/60e550550b7641705e81aa72acfc4faaebb225e7. + .distinctBy { it.patchName } + .let { if (prettyPrint) mapper.writerWithDefaultPrettyPrinter().writeValueAsString(it) else