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 77const  fs  =  require ( "node:fs/promises" ) ; 
88const  {  defineConfig }  =  require ( "@yarnpkg/types" ) ; 
99
10- const  {  compilerVersionFile }  =  require ( "#dev/paths" ) ; 
11- 
1210/** 
1311 * @param  {Yarn.Constraints.Context } ctx 
1412 */ 
@@ -46,23 +44,21 @@ async function enforceCompilerMeta({ Yarn }) {
4644    } 
4745  } 
4846
47+   const  {  compilerVersionFile }  =  await  import ( "#dev/paths" ) ; 
4948  const  versionFile  =  await  fs . readFile ( compilerVersionFile ,  "utf8" ) ; 
5049  const  versionPattern  =  / ^ l e t   v e r s i o n   =   " (?< version > [ ^ " ] + ) " $ / m; 
5150
5251  if  ( process . argv . includes ( "--fix" ) )  { 
5352    await  fs . writeFile ( 
5453      compilerVersionFile , 
55-       versionFile . replace ( 
56-         versionPattern , 
57-         `let version = "${ EXPECTED_VERSION }  "` , 
58-       ) , 
54+       versionFile . replace ( versionPattern ,  `let version = "${ EXPECTED_VERSION }  "` ) 
5955    ) ; 
6056  }  else  { 
6157    const  versionMatch  =  versionFile . match ( versionPattern ) ; 
6258    const  foundVersion  =  versionMatch ?. groups ?. version ; 
6359    if  ( foundVersion  !==  EXPECTED_VERSION )  { 
6460      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 }  .` 
6662      ) ; 
6763    } 
6864  } 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments