mirror of
https://github.com/Instadapp/chains.git
synced 2024-07-29 22:37:19 +00:00
bf8ce68096
* Validate json * wip: gh workflow test * wip: added workflow for JSON validation * Schema Improved. * Improved Workflow and Schema check for JSON files * Fixed JSON Schema * Fixed typo * Removed auto generated file * updated required fields in chainSchema * updated chain schema * removed `network` from README.md example * improved schemaCheck script * Matching ChainID with file name schema.
21 lines
647 B
JavaScript
21 lines
647 B
JavaScript
/**
|
|
* This removed `network` param from all the chain files
|
|
* Since this is the only tool here, it is here in index.js
|
|
*/
|
|
|
|
const fs = require('fs');
|
|
const chainFiles = fs.readdirSync('../_data/chains/');
|
|
|
|
for (const chainFile of chainFiles) {
|
|
const fileLocation = `../_data/chains/${chainFile}`
|
|
const fileData = fs.readFileSync(fileLocation, 'utf8')
|
|
const fileDataJson = JSON.parse(fileData)
|
|
|
|
if (fileDataJson.network) {
|
|
delete fileDataJson.network
|
|
fs.writeFileSync(fileLocation, JSON.stringify(fileDataJson, null, 2))
|
|
}
|
|
}
|
|
|
|
// Note:
|
|
// Run `npx prettier --write --ignore-unknown _data`from Project Directory
|