ocean-subgraph/scripts/replaceVersion.js

18 lines
441 B
JavaScript
Raw Normal View History

2022-06-23 13:51:32 +02:00
const fs = require('fs')
const packageJson = require('../package.json')
async function replaceVersion() {
let globalUtils = fs.readFileSync(
'./src/mappings/utils/globalUtils.ts',
'utf8'
)
globalUtils = globalUtils.replace(
/.*globalStats\.version.*\n/,
" globalStats.version = '" + packageJson.version + "'\n"
)
fs.writeFileSync('./src/mappings/utils/globalUtils.ts', globalUtils, 'utf8')
}
replaceVersion()