contracts/scripts/helpers/file_inject.js
Michael Bumann b6f34ac9a5 Pretty print JSON for contract addresses
This makes it easier to read the file and a git diff is more useful
2019-03-27 21:58:19 +01:00

9 lines
252 B
JavaScript

// help, give me a better name
const fs = require('fs');
module.exports = function (file, networkId, data) {
let content = JSON.parse(fs.readFileSync(file));
content[networkId] = data;
fs.writeFileSync(file, JSON.stringify(content, null, 2));
}