Generate code on versioning

This commit is contained in:
Wilson Lin 2020-07-03 21:22:46 +10:00
parent 9e42f25c21
commit 97e02b33b7
1 changed files with 3 additions and 0 deletions

View File

@ -4,6 +4,7 @@
const {readFileSync, writeFileSync} = require('fs');
const {spawnSync} = require('child_process');
const {join} = require('path');
const currentVersion = /^version = "(\d+)\.(\d+)\.(\d+)"\s*$/m.exec(readFileSync('Cargo.toml', 'utf8')).slice(1).map(n => Number.parseInt(n, 10));
@ -98,6 +99,8 @@ for (const f of ['README.md', 'bench/README.md']) {
replaceInFile(f, /(wilsonl\.in\/hyperbuild\/bench\/)\d+\.\d+\.\d+/g, `$1${NEW_VERSION}`);
}
cmd('npx', 'ts-node', 'attrs.ts', {workingDir: join(__dirname, 'gen')});
cmd('npx', 'ts-node', 'entities.ts', {workingDir: join(__dirname, 'gen')});
cmd('cargo', 'generate-lockfile');
cmd('git', 'add', '-A');
cmd('git', 'commit', '-m', NEW_VERSION);