File tree Expand file tree Collapse file tree 1 file changed +26
-11
lines changed Expand file tree Collapse file tree 1 file changed +26
-11
lines changed Original file line number Diff line number Diff line change 11// @ts -check 
22
3+ import  *  as  fs  from  "node:fs" ; 
4+ 
35/** 
46 * @typedef  {{ 
57 *   binDir: string, 
@@ -27,15 +29,28 @@ try {
2729  throw  new  Error ( `Platform ${ target }  ) ; 
2830} 
2931
32+ const  binPaths  =  mod . binPaths ; 
33+ // Compiler use symbolic links in the development process 
34+ if  ( fs . lstatSync ( binPaths . rescript_exe ) . isSymbolicLink ( ) )  { 
35+   for  ( const  [ key ,  binPath ]  of  Object . entries ( binPaths ) )  { 
36+     try  { 
37+       binPaths [ /** @type  {keyof BinaryPaths } */ ( key ) ]  =  fs . realpathSync ( binPath ) ; 
38+     }  catch  { 
39+       // Cannot populate the realpath of a binary, some tests may fails. 
40+       // 
41+       // But we don't report error here, 
42+       // so pass even some binaries are not built yet. 
43+     } 
44+   } 
45+ } 
46+ 
47+ export  const  platformDir  =  mod . binDir ; 
3048export  const  { 
31-   binDir : platformDir , 
32-   binPaths : { 
33-     bsb_helper_exe, 
34-     bsc_exe, 
35-     ninja_exe, 
36-     rescript_editor_analysis_exe, 
37-     rescript_tools_exe, 
38-     rescript_exe, 
39-     rewatch_exe, 
40-   } , 
41- }  =  mod ; 
49+   bsb_helper_exe, 
50+   bsc_exe, 
51+   ninja_exe, 
52+   rescript_editor_analysis_exe, 
53+   rescript_tools_exe, 
54+   rescript_exe, 
55+   rewatch_exe, 
56+ }  =  binPaths ; 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments