File tree Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change 1
- let version = "0.9.1" ;
1
+ // *** GENERATED BY "yarn setVersion" ***
2
+
3
+ let version = "0.9.1 (ReScript 7cc70c9)" ;
Original file line number Diff line number Diff line change 1
1
const fs = require ( "fs" ) ;
2
- const { version } = require ( "../package.json " ) ;
2
+ const child_process = require ( "child_process " ) ;
3
3
4
- fs . writeFileSync ( "bin/Version.re" , `let version = "${ version } ";\n` ) ;
4
+ const packageJson = fs . readFileSync ( "package.json" ) ;
5
+ const packageVersion = JSON . parse ( packageJson ) . version ;
6
+
7
+ const reScriptVersion = child_process
8
+ . execSync ( `git submodule` )
9
+ . toString ( )
10
+ . trim ( )
11
+ . split ( " " ) [ 0 ]
12
+ . substr ( 0 , 7 ) ;
13
+
14
+ const version = `${ packageVersion } (ReScript ${ reScriptVersion } )` ;
15
+
16
+ fs . writeFileSync (
17
+ "bin/Version.re" ,
18
+ `// *** GENERATED BY "yarn setVersion" ***
19
+
20
+ let version = "${ version } ";
21
+ `
22
+ ) ;
5
23
6
24
console . log ( `Version set to ${ version } ` ) ;
You can’t perform that action at this time.
0 commit comments