2022-08-28 08:19:33 +00:00
|
|
|
/**
|
|
|
|
* This removed `network` param from all the chain files
|
|
|
|
* Since this is the only tool here, it is here in index.js
|
|
|
|
*/
|
2022-08-28 10:25:46 +00:00
|
|
|
|
2022-08-28 08:19:33 +00:00
|
|
|
const fs = require('fs');
|
|
|
|
const chainFiles = fs.readdirSync('../_data/chains/');
|
|
|
|
|
2022-08-28 10:25:46 +00:00
|
|
|
for (const chainFile of chainFiles) {
|
2022-08-28 08:19:33 +00:00
|
|
|
const fileLocation = `../_data/chains/${chainFile}`
|
2022-08-28 10:25:46 +00:00
|
|
|
const fileData = fs.readFileSync(fileLocation, 'utf8')
|
2022-08-28 08:19:33 +00:00
|
|
|
const fileDataJson = JSON.parse(fileData)
|
2022-08-28 10:25:46 +00:00
|
|
|
|
|
|
|
if (fileDataJson.network) {
|
2022-08-28 08:19:33 +00:00
|
|
|
delete fileDataJson.network
|
|
|
|
fs.writeFileSync(fileLocation, JSON.stringify(fileDataJson, null, 2))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-08-28 10:25:46 +00:00
|
|
|
// Note:
|
|
|
|
// Run `npx prettier --write --ignore-unknown _data`from Project Directory
|