Skip to content

Commit 13338fe

Browse files
committed
FIX matching of color names in ColorParser.kts
1 parent 905beff commit 13338fe

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/colorparser/ColorParser.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ val themeWriters = listOf(
3636
val colorAssignmentPattern = " = Color\\(0x[0-9a-fA-F]{8}\\)".toRegex()
3737

3838
fun FileWriter.appendInterfaceFieldLineIfMatches(inputLine: String, inputColorNameSuffix: String) {
39-
if (inputLine.trim().endsWith(inputColorNameSuffix)) {
39+
if (inputLine.contains(inputColorNameSuffix)) {
4040
appendLine(
4141
" " + inputLine.replace(inputColorNameSuffix, "")
4242
.replace(colorAssignmentPattern, ": Color")
@@ -45,7 +45,7 @@ fun FileWriter.appendInterfaceFieldLineIfMatches(inputLine: String, inputColorNa
4545
}
4646

4747
fun ThemeWriter.appendLineIfMatches(line: String) {
48-
if (line.trim().endsWith(inputColorNameSuffix)) {
48+
if (line.contains(inputColorNameSuffix)) {
4949
writer.append(" override ") // Indentation + override keyword
5050
writer.appendLine(line.replace(inputColorNameSuffix, ""))
5151
}
@@ -115,4 +115,4 @@ themeWriters.forEach { themeWriter ->
115115
writeAppColorsFooter()
116116
writer.close()
117117
}
118-
}
118+
}

0 commit comments

Comments
 (0)