File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change 1
1
2
- import { execSync } from 'child_process' ;
3
- import { resolve } from 'path' ;
4
2
import { readFileSync } from 'fs' ;
5
3
6
- const tinymistExecutable = resolve ( 'out/tinymist' + ( process . platform === 'win32' ? '.exe' : '' ) ) ;
7
4
8
5
function check ( ) {
9
- const version = JSON . parse ( readFileSync ( 'package.json' , 'utf8' ) ) . version ;
10
- const expected = `tinymist ${ version } ` ;
6
+ const cargoToml = readFileSync ( '../../Cargo.toml' , 'utf8' ) ;
7
+ const cargoVersion = cargoToml . match ( / v e r s i o n = " ( .* ?) " / ) [ 1 ] ;
8
+ const pkgVersion = JSON . parse ( readFileSync ( 'package.json' , 'utf8' ) ) . version ;
11
9
12
- const output = execSync ( `${ tinymistExecutable } -V` ) . toString ( ) . trim ( ) ;
13
-
14
- if ( output !== expected ) {
15
- throw new Error ( `Version mismatch: ${ output } !== ${ expected } (in package.json)` ) ;
10
+ if ( cargoVersion !== pkgVersion ) {
11
+ throw new Error ( `Version mismatch: ${ cargoVersion } (in Cargo.toml) !== ${ pkgVersion } (in package.json)` ) ;
16
12
}
17
13
}
18
14
You can’t perform that action at this time.
0 commit comments