Skip to content

Commit d639854

Browse files
authored
Make sure icon is json (ethereum-lists#2245)
One slipped as seen in ethereum-lists#2243 MUST be merged after ethereum-lists#2243
1 parent 32179a1 commit d639854

File tree

1 file changed

+6
-1
lines changed
  • processor/src/main/kotlin/org/ethereum/lists/chains

1 file changed

+6
-1
lines changed

processor/src/main/kotlin/org/ethereum/lists/chains/Main.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,12 @@ private fun createOutputFiles() {
8282
.forEach { iconLocation ->
8383

8484
val jsonData = Klaxon().parseJsonArray(iconLocation.reader())
85-
val iconName = iconLocation.toString().replace("../_data/icons/", "").replace(".json", "")
85+
86+
if (iconLocation.extension != "json") {
87+
error("Icon must be json " + iconLocation)
88+
}
89+
90+
val iconName = iconLocation.toString().removePrefix("../_data/icons/").removeSuffix(".json")
8691

8792
val iconJson = JsonObject()
8893
iconJson["name"] = iconName

0 commit comments

Comments
 (0)