@@ -31,17 +31,16 @@ function exec(command, options = {}) {
31
31
// and returns path to its 'dist' directory.
32
32
function prepareBenchmarkProjects ( revisionList ) {
33
33
const tmpDir = path . join ( os . tmpdir ( ) , 'graphql-js-benchmark' ) ;
34
- fs . rmdirSync ( tmpDir , { recursive : true , force : true } ) ;
34
+ fs . rmSync ( tmpDir , { recursive : true , force : true } ) ;
35
35
fs . mkdirSync ( tmpDir ) ;
36
36
37
37
const setupDir = path . join ( tmpDir , 'setup' ) ;
38
- fs . rmdirSync ( setupDir , { recursive : true , force : true } ) ;
39
38
fs . mkdirSync ( setupDir ) ;
40
39
41
40
return revisionList . map ( ( revision ) => {
42
41
console . log ( `🍳 Preparing ${ revision } ...` ) ;
43
42
const projectPath = path . join ( setupDir , revision ) ;
44
- fs . rmdirSync ( projectPath , { recursive : true } ) ;
43
+ fs . rmSync ( projectPath , { recursive : true , force : true } ) ;
45
44
fs . mkdirSync ( projectPath ) ;
46
45
47
46
fs . writeFileSync (
@@ -73,12 +72,12 @@ function prepareBenchmarkProjects(revisionList) {
73
72
}
74
73
75
74
const repoDir = path . join ( tmpDir , hash ) ;
76
- fs . rmdirSync ( repoDir , { recursive : true , force : true } ) ;
75
+ fs . rmSync ( repoDir , { recursive : true , force : true } ) ;
77
76
fs . mkdirSync ( repoDir ) ;
78
77
exec ( `git archive "${ hash } " | tar -xC "${ repoDir } "` ) ;
79
78
exec ( 'npm --quiet ci' , { cwd : repoDir } ) ;
80
79
fs . renameSync ( buildNPMArchive ( repoDir ) , archivePath ) ;
81
- fs . rmdirSync ( repoDir , { recursive : true , force : true } ) ;
80
+ fs . rmSync ( repoDir , { recursive : true } ) ;
82
81
return archivePath ;
83
82
}
84
83
0 commit comments