@@ -6,7 +6,7 @@ import type {
66 DatabaseContentsWithDbScheme ,
77} from "./database-contents" ;
88import { DatabaseKind } from "./database-contents" ;
9- import { glob } from "glob " ;
9+ import { glob } from "fs/promises " ;
1010import { encodeArchiveBasePath } from "../../common/vscode/archive-filesystem-provider" ;
1111import {
1212 showAndLogInformationMessage ,
@@ -87,17 +87,22 @@ async function findDataset(parentDirectory: string): Promise<Uri> {
8787 /*
8888 * Look directly in the root
8989 */
90- let dbRelativePaths = await glob ( "db-*/" , {
90+ const dbRelativePaths : string [ ] = [ ] ;
91+ for await ( const path of glob ( "db-*/" , {
9192 cwd : parentDirectory ,
92- } ) ;
93+ } ) ) {
94+ dbRelativePaths . push ( path ) ;
95+ }
9396
9497 if ( dbRelativePaths . length === 0 ) {
9598 /*
9699 * Check If they are in the old location
97100 */
98- dbRelativePaths = await glob ( "working/db-*/" , {
101+ for await ( const path of glob ( "working/db-*/" , {
99102 cwd : parentDirectory ,
100- } ) ;
103+ } ) ) {
104+ dbRelativePaths . push ( path ) ;
105+ }
101106 }
102107 if ( dbRelativePaths . length === 0 ) {
103108 throw new InvalidDatabaseError (
@@ -118,7 +123,11 @@ async function findDataset(parentDirectory: string): Promise<Uri> {
118123
119124/** Gets the relative paths of all `.dbscheme` files in the given directory. */
120125async function getDbSchemeFiles ( dbDirectory : string ) : Promise < string [ ] > {
121- return await glob ( "*.dbscheme" , { cwd : dbDirectory } ) ;
126+ const dbSchemeFiles : string [ ] = [ ] ;
127+ for await ( const file of glob ( "*.dbscheme" , { cwd : dbDirectory } ) ) {
128+ dbSchemeFiles . push ( file ) ;
129+ }
130+ return dbSchemeFiles ;
122131}
123132
124133// exported for testing
0 commit comments