#448 - Fix file retrieval

This commit is contained in:
Elio Struyf
2022-11-05 18:29:47 +01:00
parent d701651a05
commit 082c25144f
2 changed files with 5 additions and 1 deletions

View File

@@ -20,6 +20,7 @@
### ⚡️ Optimizations
- [#431](https://github.com/estruyf/vscode-front-matter/issues/431): Performance improvements for the content dashboard
- [#448](https://github.com/estruyf/vscode-front-matter/issues/448): Retrieving files fails when content folder name and workspace folder name are the same
### 🐞 Fixes

View File

@@ -250,7 +250,10 @@ export class Folders {
for (const folder of folders) {
try {
const projectName = Folders.getProjectFolderName();
let projectStart = folder.path.split(projectName).pop();
const slashSplit = parseWinPath(folder.path).split(`/`);
const idx = slashSplit.findIndex(f => f === projectName);
let projectStart = `/${slashSplit.slice(idx + 1).join(`/`)}`;
if (projectStart) {
projectStart = projectStart.replace(/\\/g, '/');