Skip to content

Commit

Permalink
Make sure the path is correct (ethereum-lists#2341)
Browse files Browse the repository at this point in the history
Co-authored-by: ligi <[email protected]>
  • Loading branch information
ylmin and ligi authored Mar 16, 2023
1 parent 76d248b commit 4bbf72e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tools/schemaCheck.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ const Ajv = require("ajv")
const ajv = new Ajv()
const schema = require("./schema/chainSchema.json")
const { exit } = require("process")
const chainFiles = fs.readdirSync("../_data/chains/")
const path = require('path')

const resolve = (_path) => path.resolve(__dirname, _path)
const chainFiles = fs.readdirSync(resolve("../_data/chains/"))

// https://chainagnostic.org/CAIPs/caip-2
const parseChainId = (chainId) =>
Expand All @@ -13,7 +16,7 @@ const parseChainId = (chainId) =>

const filesWithErrors = []
for (const chainFile of chainFiles) {
const fileLocation = `../_data/chains/${chainFile}`
const fileLocation = resolve(`../_data/chains/${chainFile}`)
const fileData = fs.readFileSync(fileLocation, "utf8")
const fileDataJson = JSON.parse(fileData)
const fileName = chainFile.split(".")[0]
Expand Down

0 comments on commit 4bbf72e

Please sign in to comment.