From 8dec30fae3d62428d176a524b9f2e4d91fe14b8c Mon Sep 17 00:00:00 2001 From: Hongbo Wu Date: Wed, 27 Sep 2023 22:12:34 +0800 Subject: [PATCH 1/2] fix: file already exists error caused by having duplicate article titles --- src/main.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index c01dd3e..8ea0d2d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -363,7 +363,17 @@ export default class OmnivorePlugin extends Plugin { continue; } // file doesn't exist, so we need to create it - await this.app.vault.create(normalizedPath, content); + try { + await this.app.vault.create(normalizedPath, content); + } catch (error) { + if (error.toString().includes("File already exists")) { + new Notice( + `Skipping file creation: ${normalizedPath}. Please check if you have duplicated article titles and delete the file if needed.` + ); + } else { + throw error; + } + } } } From e18d5bcb3c7b9a8fb228e6285947b60fd065d9d0 Mon Sep 17 00:00:00 2001 From: Hongbo Wu Date: Thu, 28 Sep 2023 10:00:11 +0800 Subject: [PATCH 2/2] remove rupin from codeowners --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 2b85185..1bdcf24 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @jacksonh @rupin90 @satindar @sywhb +* @jacksonh @satindar @sywhb