From 0e6e776f702bf6657e0a1fb6309aafb6dfd49917 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Thu, 27 Jun 2024 21:35:20 +0200 Subject: [PATCH] #827 - Fix team settings file recreation --- CHANGELOG.md | 2 ++ src/helpers/SettingsHelper.ts | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5eadff33..d5e64abb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ ### 🐞 Fixes +- [#827](https://github.com/estruyf/vscode-front-matter/issues/827): Fix for `frontmatter.json` file which gets created when already present in a sub-folder + ## [10.2.0] - 2024-06-12 - [Release notes](https://beta.frontmatter.codes/updates/v10.2.0) ### ✨ New features diff --git a/src/helpers/SettingsHelper.ts b/src/helpers/SettingsHelper.ts index 58c844cf..20d5f786 100644 --- a/src/helpers/SettingsHelper.ts +++ b/src/helpers/SettingsHelper.ts @@ -516,7 +516,9 @@ ${JSON.stringify(value, null, 2)}`, }frontmatter.codes/frontmatter.schema.json` }; - if (wsFolder) { + const projectFile = await Settings.projectConfigPath(); + + if (wsFolder && !projectFile) { const configPath = join(wsFolder.fsPath, Settings.globalFile); if (!(await existsAsync(configPath))) { await writeFileAsync(configPath, JSON.stringify(initialConfig, null, 2), 'utf8');