From 934e2d674b109e242aeb66d607c72230f0ebd84c Mon Sep 17 00:00:00 2001 From: ligi Date: Fri, 5 Feb 2021 11:52:13 +0100 Subject: [PATCH] Support deprecated directory --- src/main/kotlin/org/ethereum/lists/chains/Main.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/org/ethereum/lists/chains/Main.kt b/src/main/kotlin/org/ethereum/lists/chains/Main.kt index cdb9168e..74cee68a 100644 --- a/src/main/kotlin/org/ethereum/lists/chains/Main.kt +++ b/src/main/kotlin/org/ethereum/lists/chains/Main.kt @@ -13,10 +13,16 @@ val parsedNames= mutableSetOf() fun main(args: Array) { - File("_data/chains").listFiles()?.forEach { + val allFiles = File("_data/chains").listFiles()?:return + allFiles.filter { !it.isDirectory }.forEach { checkChain(it, args.contains("rpcConnect")) } + allFiles.filter { it.isDirectory }.forEach { + if (it.name != "deprecated") { + error("the only directory allowed is 'deprecated'") + } + } } fun checkChain(it: File, connectRPC: Boolean) {