From e7ac39ef81d8fd3b3dd25311530bce58f075d454 Mon Sep 17 00:00:00 2001 From: JackGruber <24863925+JackGruber@users.noreply.github.com> Date: Sun, 3 Dec 2023 11:34:48 +0100 Subject: [PATCH] Fix: #62 Better error msg --- CHANGELOG.md | 1 + src/Backup.ts | 3 +++ src/locales/de_DE.json | 1 + src/locales/en_US.json | 1 + 4 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 66cef6a..59b9ea2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## not released - Fix: #61 On Jex backup, do not overwrite already exported notebooks if the notebooks name differs only in special characters +- Fix: #62 Better error message if the Joplin profile directory is set as backup path ## v1.3.3 (2023-07-08) diff --git a/src/Backup.ts b/src/Backup.ts index 2127bd2..46c084c 100644 --- a/src/Backup.ts +++ b/src/Backup.ts @@ -289,6 +289,9 @@ class Backup { if (path.normalize(profileDir) === this.backupBasePath) { this.backupBasePath = null; + await this.showError( + i18n.__("error.backupPathJoplinDir", path.normalize(profileDir)) + ); } } diff --git a/src/locales/de_DE.json b/src/locales/de_DE.json index 16e54d1..d17bb94 100644 --- a/src/locales/de_DE.json +++ b/src/locales/de_DE.json @@ -41,6 +41,7 @@ "error.Backup": "Backup Fehler für %s: %s", "error.fileCopy": "Fehler beim kopieren von Datei/Ordner in %s: %s", "error.deleteFile": "Fehler beim löschen von Datei/Ordner in %s: %s", + "error.backupPathJoplinDir": "Als Sicherungs Pfad wurde das Joplin profile Verzeichniss (%s) ohne Unterordner ausgewählt, dies ist nicht erlaubt!", "command.createBackup": "Backup erstellen", "error.BackupSetNotSupportedChars": "Der Name des Backup-Sets enthält nicht zulässige Zeichen ( %s )!", "error.passwordDoubleQuotes": "Das Passwort enthält \" (Doppelte Anführungszeichen), diese sind wegen eines Bugs nicht erlaubt. Der Passwortschutz für die Backups wurde deaktivert!" diff --git a/src/locales/en_US.json b/src/locales/en_US.json index c3cd0c9..341067f 100644 --- a/src/locales/en_US.json +++ b/src/locales/en_US.json @@ -41,6 +41,7 @@ "error.Backup": "Backup error for %s: %s", "error.fileCopy": "Error on file/folder copy in %s: %s", "error.deleteFile": "Error on file/folder delete in %s: %s", + "error.backupPathJoplinDir": "The backup path is the Joplin profile directory (%s) without subfolders, this is not allowed!", "command.createBackup": "Create backup", "error.BackupSetNotSupportedChars": "Backup set name does contain not allowed characters ( %s )!", "error.passwordDoubleQuotes": "Password contains \" (double quotes), these are not allowed because of a bug. Password protection for the backup is deactivated!"