From e1a6721f7d748a01e2b92a99da1a48b54effd48d Mon Sep 17 00:00:00 2001 From: MathieuG-P <40181755+Zagrios@users.noreply.github.com> Date: Mon, 20 Mar 2023 00:46:40 +0100 Subject: [PATCH] [hotfix] When link folder, if folder not exist, not create empty backup --- src/main/services/folder-linker.service.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/services/folder-linker.service.ts b/src/main/services/folder-linker.service.ts index 81a3884d..0fee81b5 100644 --- a/src/main/services/folder-linker.service.ts +++ b/src/main/services/folder-linker.service.ts @@ -52,13 +52,14 @@ export class FolderLinkerService { const sharedPath = this.getSharedFolder(folderPath, options?.intermediateFolder); - await ensureFolderExist(folderPath); await ensureFolderExist(sharedPath); if(options?.backup === true){ await this.backupFolder(folderPath); } + await ensureFolderExist(folderPath); + if(options?.keepContents !== false){ await moveFolderContent(folderPath, sharedPath).toPromise(); } @@ -75,6 +76,8 @@ export class FolderLinkerService { const sharedPath = this.getSharedFolder(folderPath, options?.intermediateFolder); + lstat(sharedPath).then(console.log); + await ensureFolderExist(folderPath); if(options?.backup === true){