@@ -12,7 +12,9 @@ console.log('dirname', dirname);
1212
1313async function main ( ) : Promise < void > {
1414 console . log ( 'mkdir' , path . join ( dirname , 'results' ) ) ;
15- await fs . promises . mkdir ( path . join ( dirname , 'results' ) , { recursive : true } ) ;
15+ await fs . promises . mkdir ( url . pathToFileURL ( path . join ( dirname , 'results' ) ) , {
16+ recursive : true ,
17+ } ) ;
1618 // Running all suites
1719 for await ( const suitePath of fsWalk ( suitesPath ) ) {
1820 // Skip over non-ts and non-js files
@@ -29,28 +31,30 @@ async function main(): Promise<void> {
2931 }
3032 // Concatenating metrics
3133 const metricsPath = path . join ( resultsPath , 'metrics.txt' ) ;
32- await fs . promises . rm ( metricsPath , { force : true } ) ;
34+ await fs . promises . rm ( url . pathToFileURL ( metricsPath ) , { force : true } ) ;
3335 let concatenating = false ;
3436 for await ( const metricPath of fsWalk ( resultsPath ) ) {
3537 // Skip over non-metrics files
3638 if ( ! metricPath . endsWith ( '_metrics.txt' ) ) {
3739 continue ;
3840 }
39- const metricData = await fs . promises . readFile ( metricPath ) ;
41+ const metricData = await fs . promises . readFile (
42+ url . pathToFileURL ( metricPath ) ,
43+ ) ;
4044 if ( concatenating ) {
41- await fs . promises . appendFile ( metricsPath , '\n' ) ;
45+ await fs . promises . appendFile ( url . pathToFileURL ( metricsPath ) , '\n' ) ;
4246 }
43- await fs . promises . appendFile ( metricsPath , metricData ) ;
47+ await fs . promises . appendFile ( url . pathToFileURL ( metricsPath ) , metricData ) ;
4448 concatenating = true ;
4549 }
4650 const systemData = await si . get ( {
4751 cpu : '*' ,
4852 osInfo : 'platform, distro, release, kernel, arch' ,
4953 system : 'model, manufacturer' ,
5054 } ) ;
51- console . log ( 'write file' , path . join ( dirname , 'results' , 'system.json' ) )
55+ console . log ( 'write file' , path . join ( dirname , 'results' , 'system.json' ) ) ;
5256 await fs . promises . writeFile (
53- path . join ( dirname , 'results' , 'system.json' ) ,
57+ url . pathToFileURL ( path . join ( dirname , 'results' , 'system.json' ) ) ,
5458 JSON . stringify ( systemData , null , 2 ) ,
5559 ) ;
5660}
0 commit comments