From 3c75ddf682b4e486db7a589d6ed3155ca5e338ba Mon Sep 17 00:00:00 2001 From: ligi Date: Mon, 13 Jun 2022 08:46:27 +0200 Subject: [PATCH] Skip errors on copy (e.g. already exists) --- processor/src/main/kotlin/org/ethereum/lists/chains/Main.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/processor/src/main/kotlin/org/ethereum/lists/chains/Main.kt b/processor/src/main/kotlin/org/ethereum/lists/chains/Main.kt index 45820698..16422942 100644 --- a/processor/src/main/kotlin/org/ethereum/lists/chains/Main.kt +++ b/processor/src/main/kotlin/org/ethereum/lists/chains/Main.kt @@ -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() val parsedNames = mutableSetOf() @@ -39,7 +40,8 @@ private fun createOutputFiles() { val miniChainJSONArray = JsonArray() 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() }