Skip to content

Commit

Permalink
Make sure icon is json (ethereum-lists#2245)
Browse files Browse the repository at this point in the history
One slipped as seen in ethereum-lists#2243

MUST be merged after ethereum-lists#2243
  • Loading branch information
ligi authored Feb 8, 2023
1 parent 32179a1 commit d639854
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion processor/src/main/kotlin/org/ethereum/lists/chains/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,12 @@ private fun createOutputFiles() {
.forEach { iconLocation ->

val jsonData = Klaxon().parseJsonArray(iconLocation.reader())
val iconName = iconLocation.toString().replace("../_data/icons/", "").replace(".json", "")

if (iconLocation.extension != "json") {
error("Icon must be json " + iconLocation)
}

val iconName = iconLocation.toString().removePrefix("../_data/icons/").removeSuffix(".json")

val iconJson = JsonObject()
iconJson["name"] = iconName
Expand Down

0 comments on commit d639854

Please sign in to comment.