Replicate previous behaviour
This commit is contained in:
parent
f2a764aac2
commit
5ffc2f20fd
1 changed files with 5 additions and 2 deletions
|
@ -547,6 +547,9 @@ class ExportService {
|
|||
isCanceled: CancellationStatus,
|
||||
) {
|
||||
const fs = ensureElectron().fs;
|
||||
const rmdirIfExists = async (dirPath: string) => {
|
||||
if (await fs.exists(dirPath)) await fs.rmdir(dirPath);
|
||||
};
|
||||
try {
|
||||
const exportRecord = await this.getExportRecord(exportFolder);
|
||||
const collectionIDPathMap =
|
||||
|
@ -581,11 +584,11 @@ class ExportService {
|
|||
);
|
||||
try {
|
||||
// delete the collection metadata folder
|
||||
await fs.rmdir(
|
||||
await rmdirIfExists(
|
||||
getMetadataFolderExportPath(collectionExportPath),
|
||||
);
|
||||
// delete the collection folder
|
||||
await fs.rmdir(collectionExportPath);
|
||||
await rmdirIfExists(collectionExportPath);
|
||||
} catch (e) {
|
||||
await this.addCollectionExportedRecord(
|
||||
exportFolder,
|
||||
|
|
Loading…
Add table
Reference in a new issue