@@ -5,9 +5,8 @@ import { fileURLToPath } from "url";
5
5
import { parse as parseYaml } from "yaml" ;
6
6
import { spawn } from "child_process" ;
7
7
import fsExtra from "fs-extra" ;
8
- import { glob } from "glob" ;
9
8
10
- const { readFileSync, mkdirp, rm } = fsExtra ;
9
+ const { readFileSync, mkdirp, rmdir } = fsExtra ;
11
10
12
11
const __dirname = dirname ( fileURLToPath ( import . meta. url ) ) ;
13
12
@@ -58,10 +57,10 @@ const scenarios: Scenario[] = [
58
57
name : scenario . name ,
59
58
setup : async ( cwd : string ) => {
60
59
const configContent = scenario . config ;
61
-
62
- // Remove any existing next.config.* files
63
- // eslint-disable-next-line @typescript-eslint/await-thenable
64
- const configFiles = await glob ( join ( cwd , "next.config.*" ) ) ;
60
+ const files = await fsExtra . readdir ( cwd ) ;
61
+ const configFiles = files . filter ( file => file . startsWith ( ' next.config.' ) )
62
+ . map ( file => join ( cwd , file ) ) ;
63
+
65
64
for ( const file of configFiles ) {
66
65
await fsExtra . remove ( file ) ;
67
66
console . log ( `Removed existing config file: ${ file } ` ) ;
@@ -77,7 +76,7 @@ const scenarios: Scenario[] = [
77
76
78
77
const errors : any [ ] = [ ] ;
79
78
80
- await rm ( join ( __dirname , "runs" ) , { recursive : true } ) . catch ( ( ) => undefined ) ;
79
+ await rmdir ( join ( __dirname , "runs" ) , { recursive : true } ) . catch ( ( ) => undefined ) ;
81
80
82
81
// Run each scenario
83
82
for ( const scenario of scenarios ) {
0 commit comments