@@ -980,14 +980,14 @@ export class DatabaseUI extends DisposableObject {
980
980
byFolder : boolean ,
981
981
progress : ProgressCallback ,
982
982
) : Promise < DatabaseItem | undefined > {
983
- if ( byFolder && ! uri . fsPath . endsWith ( "testproj" ) ) {
983
+ if ( byFolder && ! uri . fsPath . endsWith ( ". testproj" ) ) {
984
984
const fixedUri = await this . fixDbUri ( uri ) ;
985
985
// we are selecting a database folder
986
986
return await this . databaseManager . openDatabase ( fixedUri , {
987
987
type : "folder" ,
988
988
} ) ;
989
989
} else {
990
- // we are selecting a database archive or a testproj.
990
+ // we are selecting a database archive or a . testproj.
991
991
// Unzip archives (if an archive) and copy into a workspace-controlled area
992
992
// before importing.
993
993
return await this . databaseFetcher . importLocalDatabase (
@@ -1028,6 +1028,7 @@ export class DatabaseUI extends DisposableObject {
1028
1028
const databases : DatabaseItem [ ] = [ ] ;
1029
1029
const failures : string [ ] = [ ] ;
1030
1030
const entries = await workspace . fs . readDirectory ( uri ) ;
1031
+ const validFileTypes = [ FileType . File , FileType . Directory ] ;
1031
1032
1032
1033
for ( const [ index , entry ] of entries . entries ( ) ) {
1033
1034
progress ( {
@@ -1044,10 +1045,19 @@ export class DatabaseUI extends DisposableObject {
1044
1045
} ) ;
1045
1046
} ;
1046
1047
1048
+ if ( ! validFileTypes . includes ( entry [ 1 ] ) ) {
1049
+ void this . app . logger . log (
1050
+ `Skip import ${ entry } , invalid FileType: ${ entry [ 1 ] } ` ,
1051
+ ) ;
1052
+ continue ;
1053
+ }
1054
+
1047
1055
try {
1048
- const fixedUri = await this . fixDbUri ( Uri . joinPath ( uri , entry [ 0 ] ) ) ;
1056
+ const databaseUri = Uri . joinPath ( uri , entry [ 0 ] ) ;
1057
+ void this . app . logger . log ( `Importing from ${ databaseUri } ` ) ;
1058
+
1049
1059
const database = await this . importDatabase (
1050
- fixedUri ,
1060
+ databaseUri ,
1051
1061
entry [ 1 ] === FileType . Directory ,
1052
1062
subProgress ,
1053
1063
) ;
@@ -1056,7 +1066,7 @@ export class DatabaseUI extends DisposableObject {
1056
1066
} else {
1057
1067
failures . push ( entry [ 0 ] ) ;
1058
1068
}
1059
- } catch ( e ) {
1069
+ } catch {
1060
1070
failures . push ( entry [ 0 ] ) ;
1061
1071
}
1062
1072
}
0 commit comments