mirror of
https://github.com/estruyf/vscode-front-matter.git
synced 2026-07-13 13:21:03 +02:00
#334 - Fix for locked content folders retrieval
This commit is contained in:
@@ -10,6 +10,9 @@
|
|||||||
|
|
||||||
### 🐞 Fixes
|
### 🐞 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)
|
## [7.2.0] - 2022-05-02 - [Release notes](https://beta.frontmatter.codes/updates/v7.2.0)
|
||||||
|
|
||||||
### 🎨 Enhancements
|
### 🎨 Enhancements
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { ContentFolder, FileInfo, FolderInfo } from "../models";
|
|||||||
import uniqBy = require("lodash.uniqby");
|
import uniqBy = require("lodash.uniqby");
|
||||||
import { Template } from "./Template";
|
import { Template } from "./Template";
|
||||||
import { Notifications } from "../helpers/Notifications";
|
import { Notifications } from "../helpers/Notifications";
|
||||||
import { Settings } from "../helpers";
|
import { Logger, Settings } from "../helpers";
|
||||||
import { existsSync, mkdirSync } from 'fs';
|
import { existsSync, mkdirSync } from 'fs';
|
||||||
import { format } from 'date-fns';
|
import { format } from 'date-fns';
|
||||||
import { Dashboard } from './Dashboard';
|
import { Dashboard } from './Dashboard';
|
||||||
@@ -362,7 +362,11 @@ export class Folders {
|
|||||||
let folders: string[] = [];
|
let folders: string[] = [];
|
||||||
|
|
||||||
for (const pattern of patterns) {
|
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
|
// Filter out the workspace folder
|
||||||
|
|||||||
@@ -19,8 +19,6 @@ export class DashboardSettings {
|
|||||||
const ext = Extension.getInstance();
|
const ext = Extension.getInstance();
|
||||||
const wsFolder = Folders.getWorkspaceFolder();
|
const wsFolder = Folders.getWorkspaceFolder();
|
||||||
const isInitialized = await Template.isInitialized();
|
const isInitialized = await Template.isInitialized();
|
||||||
|
|
||||||
const contentFolders = await Folders.getContentFolders();
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
beta: ext.isBetaVersion(),
|
beta: ext.isBetaVersion(),
|
||||||
@@ -56,7 +54,7 @@ export class DashboardSettings {
|
|||||||
mimeTypes: Settings.get<string[]>(SETTING_MEDIA_SUPPORTED_MIMETYPES)
|
mimeTypes: Settings.get<string[]>(SETTING_MEDIA_SUPPORTED_MIMETYPES)
|
||||||
},
|
},
|
||||||
welcome: {
|
welcome: {
|
||||||
contentFolders
|
contentFolders: !isInitialized ? await Folders.getContentFolders() : []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
dataFiles: await this.getDataFiles(),
|
dataFiles: await this.getDataFiles(),
|
||||||
|
|||||||
Reference in New Issue
Block a user