Skip to content

Commit ec3371f

Browse files
committed
fix: Indent patch option description correctly
1 parent 44e36fe commit ec3371f

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

src/main/kotlin/app/revanced/patches/youtube/layout/branding/CustomBrandingPatch.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage
66
import app.revanced.patcher.patch.annotation.Patch
77
import app.revanced.patcher.patch.options.PatchOption.PatchExtensions.stringPatchOption
88
import app.revanced.util.ResourceGroup
9+
import app.revanced.util.Utils.trimIndentMultiline
910
import app.revanced.util.copyResources
1011
import java.io.File
1112
import java.nio.file.Files
@@ -64,10 +65,7 @@ object CustomBrandingPatch : ResourcePatch() {
6465
Each of these folders has to have the following files:
6566
6667
${iconResourceFileNames.joinToString("\n") { "- $it" }}
67-
"""
68-
.split("\n")
69-
.joinToString("\n") { it.trimIndent() } // Remove the leading whitespace from each line.
70-
.trimIndent(), // Remove the leading newline.
68+
""".trimIndentMultiline()
7169
)
7270

7371
override fun execute(context: ResourceContext) {

src/main/kotlin/app/revanced/patches/youtube/layout/branding/header/ChangeHeaderPatch.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage
77
import app.revanced.patcher.patch.annotation.Patch
88
import app.revanced.patcher.patch.options.PatchOption.PatchExtensions.stringPatchOption
99
import app.revanced.util.ResourceGroup
10+
import app.revanced.util.Utils.trimIndentMultiline
1011
import app.revanced.util.copyResources
1112
import java.io.File
1213

@@ -56,7 +57,7 @@ object ChangeHeaderPatch : ResourcePatch() {
5657
These folders must contain the following files:
5758
5859
${variants.joinToString("\n") { variant -> "- ${HEADER_NAME}_$variant.png" }}
59-
""".trimIndent(),
60+
""".trimIndentMultiline(),
6061
required = true,
6162
)
6263

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package app.revanced.util
2+
3+
internal object Utils {
4+
internal fun String.trimIndentMultiline() =
5+
this.split("\n")
6+
.joinToString("\n") { it.trimIndent() } // Remove the leading whitespace from each line.
7+
.trimIndent() // Remove the leading newline.
8+
}

0 commit comments

Comments
 (0)