File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ export async function databaseFetcher(
5757 step : 3
5858 } ) ;
5959
60- const dbPath = await findDirWithFile ( unzipPath , '.dbinfo' ) ;
60+ const dbPath = await findDirWithFile ( unzipPath , '.dbinfo' , 'codeql-database.yml' ) ;
6161 if ( dbPath ) {
6262 // might need to upgrade before importing...
6363 const item = await databasesManager . openDatabase ( Uri . parse ( dbPath ) ) ;
@@ -149,17 +149,17 @@ function isFile(databaseUrl: string) {
149149 *
150150 * @returns the directory containing the file, or undefined if not found.
151151 */
152- async function findDirWithFile ( dir : string , toFind : string ) : Promise < string | undefined > {
152+ async function findDirWithFile ( dir : string , ... toFind : string [ ] ) : Promise < string | undefined > {
153153 if ( ! ( await fs . stat ( dir ) ) . isDirectory ( ) ) {
154154 return ;
155155 }
156156 const files = await fs . readdir ( dir ) ;
157- if ( files . includes ( toFind ) ) {
157+ if ( toFind . some ( file => files . includes ( file ) ) ) {
158158 return dir ;
159159 }
160160 for ( const file of files ) {
161161 const newPath = path . join ( dir , file ) ;
162- const result = await findDirWithFile ( newPath , toFind ) ;
162+ const result = await findDirWithFile ( newPath , ... toFind ) ;
163163 if ( result ) {
164164 return result ;
165165 }
You can’t perform that action at this time.
0 commit comments