puppeteer/utils/generate_version_file.js

19 lines
508 B
JavaScript

const {writeFileSync, readFileSync} = require('fs');
const {join} = require('path');
const version = require('../package.json').version;
writeFileSync(
join(__dirname, '../src/generated/version.ts'),
readFileSync(join(__dirname, '../src/templates/version.ts.tmpl'), {
encoding: 'utf-8',
}).replace('PACKAGE_VERSION', version)
);
writeFileSync(
join(__dirname, '../versions.js'),
readFileSync(join(__dirname, '../versions.js'), {
encoding: 'utf-8',
}).replace('NEXT', `v${version}`)
);