#334 - Fix for locked content folders retrieval

This commit is contained in:
Elio Struyf
2022-05-09 09:00:36 +02:00
parent 426dbc2e46
commit 32c7bbd3f9
3 changed files with 10 additions and 5 deletions

View File

@@ -10,6 +10,9 @@
### 🐞 Fixes
- [#334](https://github.com/estruyf/vscode-front-matter/issues/334): Fix for locked content folders retrieval
## [7.2.0] - 2022-05-02 - [Release notes](https://beta.frontmatter.codes/updates/v7.2.0)
### 🎨 Enhancements

View File

@@ -6,7 +6,7 @@ import { ContentFolder, FileInfo, FolderInfo } from "../models";
import uniqBy = require("lodash.uniqby");
import { Template } from "./Template";
import { Notifications } from "../helpers/Notifications";
import { Settings } from "../helpers";
import { Logger, Settings } from "../helpers";
import { existsSync, mkdirSync } from 'fs';
import { format } from 'date-fns';
import { Dashboard } from './Dashboard';
@@ -362,7 +362,11 @@ export class Folders {
let folders: string[] = [];
for (const pattern of patterns) {
folders = [...folders, ...(await this.findFolders(pattern))];
try {
folders = [...folders, ...(await this.findFolders(pattern))];
} catch (e) {
Logger.error(`Something went wrong while searching for folders with pattern "${pattern}": ${(e as Error).message}`);
}
}
// Filter out the workspace folder

View File

@@ -19,8 +19,6 @@ export class DashboardSettings {
const ext = Extension.getInstance();
const wsFolder = Folders.getWorkspaceFolder();
const isInitialized = await Template.isInitialized();
const contentFolders = await Folders.getContentFolders();
return {
beta: ext.isBetaVersion(),
@@ -56,7 +54,7 @@ export class DashboardSettings {
mimeTypes: Settings.get<string[]>(SETTING_MEDIA_SUPPORTED_MIMETYPES)
},
welcome: {
contentFolders
contentFolders: !isInitialized ? await Folders.getContentFolders() : []
}
},
dataFiles: await this.getDataFiles(),