Skip errors on copy (e.g. already exists)

This commit is contained in:
ligi 2022-06-13 08:46:27 +02:00
parent 9e35cab9b0
commit 3c75ddf682
No known key found for this signature in database
GPG Key ID: 8E81894010ABF23D

View File

@ -13,6 +13,7 @@ import org.kethereum.erc55.isValid
import org.kethereum.model.Address import org.kethereum.model.Address
import org.kethereum.rpc.HttpEthereumRPC import org.kethereum.rpc.HttpEthereumRPC
import java.time.Duration import java.time.Duration
import kotlin.io.OnErrorAction.*
val parsedShortNames = mutableSetOf<String>() val parsedShortNames = mutableSetOf<String>()
val parsedNames = mutableSetOf<String>() val parsedNames = mutableSetOf<String>()
@ -39,7 +40,8 @@ private fun createOutputFiles() {
val miniChainJSONArray = JsonArray<JsonObject>() val miniChainJSONArray = JsonArray<JsonObject>()
val shortNameMapping = JsonObject() val shortNameMapping = JsonObject()
File(basePath, "_data").copyRecursively(buildPath) // copy raw data so e.g. icons are available - SKIP errors
File(basePath, "_data").copyRecursively(buildPath, onError = { _, _ -> SKIP })
allChainFiles allChainFiles
.map { Klaxon().parseJsonObject(it.reader()) } .map { Klaxon().parseJsonObject(it.reader()) }
.sortedBy { (it["chainId"] as Number).toLong() } .sortedBy { (it["chainId"] as Number).toLong() }