From 265db6f5dd8393d33942ee96ab00f8889c787798 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Tue, 14 Mar 2023 22:47:10 +0100 Subject: [PATCH] #537 - Allow root path --- CHANGELOG.md | 1 + src/commands/Folders.ts | 2 +- src/helpers/Telemetry.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 154391a5..39fdd304 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ - [#363](https://github.com/estruyf/vscode-front-matter/issues/363): Multiline support for the `string` field in data view - [#513](https://github.com/estruyf/vscode-front-matter/issues/513): Added support for external UI scripts to add custom HTML on the dashboard elements - [#530](https://github.com/estruyf/vscode-front-matter/issues/530): Implementation of the Front Matter AI 🤖 powered by [mendable.ai](https://mendable.ai) +- [#537](https://github.com/estruyf/vscode-front-matter/issues/537): Allow to use the root path `/` as the public folder ### 🎨 Enhancements diff --git a/src/commands/Folders.ts b/src/commands/Folders.ts index 5dd69306..bb4ecf51 100644 --- a/src/commands/Folders.ts +++ b/src/commands/Folders.ts @@ -174,7 +174,7 @@ export class Folders { public static getStaticFolderRelativePath(): string | undefined { let staticFolder = Settings.get(SETTING_CONTENT_STATIC_FOLDER); - if (staticFolder && staticFolder.includes(WORKSPACE_PLACEHOLDER)) { + if (staticFolder && (staticFolder.includes(WORKSPACE_PLACEHOLDER) || staticFolder === '/')) { staticFolder = Folders.getAbsFilePath(staticFolder); const wsFolder = Folders.getWorkspaceFolder(); if (wsFolder) { diff --git a/src/helpers/Telemetry.ts b/src/helpers/Telemetry.ts index 57e5fddd..1bd9ccc3 100644 --- a/src/helpers/Telemetry.ts +++ b/src/helpers/Telemetry.ts @@ -69,6 +69,6 @@ export class Telemetry { }); // Reset the events this.events = []; - }, 1000) as NodeJS.Timeout; + }, 1000) as any as NodeJS.Timeout; } }