When importing from a directory, check for testproj

Use the testproj style import when using the folder icon to import a
database. This means that if the database directory ends with `testproj`
copy the database into workspace storage and make it available for
re-importing when the origin database changes.
This commit is contained in:
Andrew Eisenberg
2024-03-17 11:27:35 -07:00
parent d57255152c
commit fe957db17a

View File

@@ -995,14 +995,15 @@ export class DatabaseUI extends DisposableObject {
return undefined; return undefined;
} }
if (byFolder) { if (byFolder && !uri.fsPath.endsWith("testproj")) {
const fixedUri = await this.fixDbUri(uri); const fixedUri = await this.fixDbUri(uri);
// we are selecting a database folder // we are selecting a database folder
return await this.databaseManager.openDatabase(fixedUri, { return await this.databaseManager.openDatabase(fixedUri, {
type: "folder", type: "folder",
}); });
} else { } else {
// we are selecting a database archive. Must unzip into a workspace-controlled area // we are selecting a database archive or a testproj.
// Unzip archives (if an archive) and copy into a workspace-controlled area
// before importing. // before importing.
return await importLocalDatabase( return await importLocalDatabase(
this.app.commands, this.app.commands,