File tree Expand file tree Collapse file tree 3 files changed +12
-5
lines changed
src/main/kotlin/app/revanced
patches/youtube/layout/branding Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage
66import app.revanced.patcher.patch.annotation.Patch
77import app.revanced.patcher.patch.options.PatchOption.PatchExtensions.stringPatchOption
88import app.revanced.util.ResourceGroup
9+ import app.revanced.util.Utils.trimIndentMultiline
910import app.revanced.util.copyResources
1011import java.io.File
1112import 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 ) {
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage
77import app.revanced.patcher.patch.annotation.Patch
88import app.revanced.patcher.patch.options.PatchOption.PatchExtensions.stringPatchOption
99import app.revanced.util.ResourceGroup
10+ import app.revanced.util.Utils.trimIndentMultiline
1011import app.revanced.util.copyResources
1112import 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
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments