Make sure icon is json

One slipped as seen in #2243

MUST be merged after #2243
This commit is contained in:
ligi 2023-02-06 17:19:45 +01:00
parent 33dcd88325
commit c93995c329
No known key found for this signature in database
GPG Key ID: 8E81894010ABF23D

View File

@ -82,7 +82,12 @@ private fun createOutputFiles() {
.forEach { iconLocation -> .forEach { iconLocation ->
val jsonData = Klaxon().parseJsonArray(iconLocation.reader()) 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() val iconJson = JsonObject()
iconJson["name"] = iconName iconJson["name"] = iconName