mirror of
https://github.com/revanced/revanced-patches
synced 2024-11-01 01:02:58 +01:00
fix: Indent patch option description correctly
This commit is contained in:
parent
fcf5fe632c
commit
bd86ef6fc2
@ -6,6 +6,7 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patcher.patch.options.PatchOption.PatchExtensions.stringPatchOption
|
||||
import app.revanced.util.ResourceGroup
|
||||
import app.revanced.util.Utils.trimIndentMultiline
|
||||
import app.revanced.util.copyResources
|
||||
import java.io.File
|
||||
import java.nio.file.Files
|
||||
@ -64,10 +65,7 @@ object CustomBrandingPatch : ResourcePatch() {
|
||||
Each of these folders has to have the following files:
|
||||
|
||||
${iconResourceFileNames.joinToString("\n") { "- $it" }}
|
||||
"""
|
||||
.split("\n")
|
||||
.joinToString("\n") { it.trimIndent() } // Remove the leading whitespace from each line.
|
||||
.trimIndent(), // Remove the leading newline.
|
||||
""".trimIndentMultiline()
|
||||
)
|
||||
|
||||
override fun execute(context: ResourceContext) {
|
||||
|
@ -7,6 +7,7 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patcher.patch.options.PatchOption.PatchExtensions.stringPatchOption
|
||||
import app.revanced.util.ResourceGroup
|
||||
import app.revanced.util.Utils.trimIndentMultiline
|
||||
import app.revanced.util.copyResources
|
||||
import java.io.File
|
||||
|
||||
@ -56,7 +57,7 @@ object ChangeHeaderPatch : ResourcePatch() {
|
||||
These folders must contain the following files:
|
||||
|
||||
${variants.joinToString("\n") { variant -> "- ${HEADER_NAME}_$variant.png" }}
|
||||
""".trimIndent(),
|
||||
""".trimIndentMultiline(),
|
||||
required = true,
|
||||
)
|
||||
|
||||
|
8
src/main/kotlin/app/revanced/util/Utils.kt
Normal file
8
src/main/kotlin/app/revanced/util/Utils.kt
Normal file
@ -0,0 +1,8 @@
|
||||
package app.revanced.util
|
||||
|
||||
internal object Utils {
|
||||
internal fun String.trimIndentMultiline() =
|
||||
this.split("\n")
|
||||
.joinToString("\n") { it.trimIndent() } // Remove the leading whitespace from each line.
|
||||
.trimIndent() // Remove the leading newline.
|
||||
}
|
Loading…
Reference in New Issue
Block a user