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

This commit is contained in:
ligi 2022-06-13 08:55:31 +02:00 committed by GitHub
parent 15316f9bc6
commit 2f24c402a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,6 +13,7 @@ import org.kethereum.erc55.isValid
import org.kethereum.model.Address
import org.kethereum.rpc.HttpEthereumRPC
import java.time.Duration
import kotlin.io.OnErrorAction.*
val parsedShortNames = mutableSetOf<String>()
val parsedNames = mutableSetOf<String>()
@ -39,7 +40,8 @@ private fun createOutputFiles() {
val miniChainJSONArray = JsonArray<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
.map { Klaxon().parseJsonObject(it.reader()) }
.sortedBy { (it["chainId"] as Number).toLong() }