Make sure icon is json (#2245)

One slipped as seen in #2243

MUST be merged after #2243
This commit is contained in:
ligi 2023-02-08 18:59:54 +01:00 committed by GitHub
parent 32179a120f
commit d639854843
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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