diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 9290f65d..72309243 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -301,7 +301,7 @@ }, "folder": { "desc": "Use {{owner}}, {{repo}} and {{branch}} to dynamically name the folder.", - "title": "Folder where the repository will be simulated" + "title": "Folder where the repository will be simulated (test mode only)" } }, "ghToken": { diff --git a/src/i18n/locales/fr.json b/src/i18n/locales/fr.json index c2dd44bb..ad32de71 100644 --- a/src/i18n/locales/fr.json +++ b/src/i18n/locales/fr.json @@ -300,7 +300,7 @@ }, "folder": { "desc": "Utilisez {{owner}}, {{repo}} et {{branch}} pour nommer dynamiquement le dossier.", - "title": "Dossier où le dépôt sera simulé" + "title": "Dossier où le dépôt sera simulé (test mode uniquement)" } }, "ghToken": { diff --git a/src/settings.ts b/src/settings.ts index f6a8cf4b..dc694884 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -306,20 +306,20 @@ export class GithubPublisherSettingsTab extends PluginSettingTab { this.renderSettingsPage(EnumbSettingsTabId.github); }) ); - if (githubSettings.dryRun.enable) { - new Setting(this.settingsPage) - .setName(i18next.t("settings.github.dryRun.folder.title")) - .setDesc(i18next.t("settings.github.dryRun.folder.desc")) - .addText((text) => - text - .setPlaceholder("github-publisher") - .setValue(githubSettings.dryRun.folderName) - .onChange(async (value) => { - githubSettings.dryRun.folderName = value.trim(); - await this.plugin.saveSettings(); - }) - ); - } + + new Setting(this.settingsPage) + .setName(i18next.t("settings.github.dryRun.folder.title")) + .setDesc(i18next.t("settings.github.dryRun.folder.desc")) + .addText((text) => + text + .setPlaceholder("github-publisher") + .setValue(githubSettings.dryRun.folderName) + .onChange(async (value) => { + githubSettings.dryRun.folderName = value.trim(); + await this.plugin.saveSettings(); + }) + ); + new Setting(this.settingsPage) .setClass("no-display") diff --git a/src/utils/data_validation_test.ts b/src/utils/data_validation_test.ts index 15e55231..7a0fa3c6 100644 --- a/src/utils/data_validation_test.ts +++ b/src/utils/data_validation_test.ts @@ -432,7 +432,7 @@ export function isFolderNote(properties: MultiProperties) { } export function isInDryRunFolder(settings: GitHubPublisherSettings, repo: Repository | null, file: TFile | TFolder) { - if (!settings.github.dryRun.enable) return false; + if (settings.github.dryRun.folderName.trim().length ===0) return false; const variables = { owner: repo?.user ?? settings.github.user, repo: repo?.repo ?? settings.github.repo,