update to use new checkExistsAndCreateDir api

This commit is contained in:
Abhinav 2023-03-23 12:21:01 +05:30
parent 6d578a534d
commit c3e1fc99b7
2 changed files with 4 additions and 6 deletions

View file

@ -77,9 +77,7 @@ class ExportService {
return; return;
} }
const newExportDir = `${newRootDir}/${ENTE_EXPORT_DIRECTORY}`; const newExportDir = `${newRootDir}/${ENTE_EXPORT_DIRECTORY}`;
await this.electronAPIs.checkExistsAndCreateCollectionDir( await this.electronAPIs.checkExistsAndCreateDir(newExportDir);
newExportDir
);
callback(newExportDir); callback(newExportDir);
} catch (e) { } catch (e) {
logError(e, 'changeExportDirectory failed'); logError(e, 'changeExportDirectory failed');
@ -408,10 +406,10 @@ class ExportService {
exportFolder, exportFolder,
collection collection
); );
await this.electronAPIs.checkExistsAndCreateCollectionDir( await this.electronAPIs.checkExistsAndCreateDir(
collectionFolderPath collectionFolderPath
); );
await this.electronAPIs.checkExistsAndCreateCollectionDir( await this.electronAPIs.checkExistsAndCreateDir(
getMetadataFolderPath(collectionFolderPath) getMetadataFolderPath(collectionFolderPath)
); );
await this.addCollectionExportedRecord( await this.addCollectionExportedRecord(

View file

@ -9,7 +9,7 @@ export interface AppUpdateInfo {
export interface ElectronAPIs { export interface ElectronAPIs {
exists: (path: string) => boolean; exists: (path: string) => boolean;
checkExistsAndCreateCollectionDir: (dirPath: string) => Promise<void>; checkExistsAndCreateDir: (dirPath: string) => Promise<void>;
checkExistsAndRename: ( checkExistsAndRename: (
oldDirPath: string, oldDirPath: string,
newDirPath: string newDirPath: string