File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change 7
7
const fs = require ( "node:fs/promises" ) ;
8
8
const { defineConfig } = require ( "@yarnpkg/types" ) ;
9
9
10
- const { compilerVersionFile } = require ( "#dev/paths" ) ;
11
-
12
10
/**
13
11
* @param {Yarn.Constraints.Context } ctx
14
12
*/
@@ -46,23 +44,21 @@ async function enforceCompilerMeta({ Yarn }) {
46
44
}
47
45
}
48
46
47
+ const { compilerVersionFile } = await import ( "#dev/paths" ) ;
49
48
const versionFile = await fs . readFile ( compilerVersionFile , "utf8" ) ;
50
49
const versionPattern = / ^ l e t v e r s i o n = " (?< version > [ ^ " ] + ) " $ / m;
51
50
52
51
if ( process . argv . includes ( "--fix" ) ) {
53
52
await fs . writeFile (
54
53
compilerVersionFile ,
55
- versionFile . replace (
56
- versionPattern ,
57
- `let version = "${ EXPECTED_VERSION } "` ,
58
- ) ,
54
+ versionFile . replace ( versionPattern , `let version = "${ EXPECTED_VERSION } "` )
59
55
) ;
60
56
} else {
61
57
const versionMatch = versionFile . match ( versionPattern ) ;
62
58
const foundVersion = versionMatch ?. groups ?. version ;
63
59
if ( foundVersion !== EXPECTED_VERSION ) {
64
60
Yarn . workspace ( ) . error (
65
- `compiler/common/bs_version.ml file need to be fixed; expected ${ EXPECTED_VERSION } , found ${ foundVersion } .` ,
61
+ `compiler/common/bs_version.ml file need to be fixed; expected ${ EXPECTED_VERSION } , found ${ foundVersion } .`
66
62
) ;
67
63
}
68
64
}
You can’t perform that action at this time.
0 commit comments