#488 - Create the .frontmatter folder on initialization, not before

This commit is contained in:
Elio Struyf
2023-02-02 21:06:20 +01:00
parent 2b7f124582
commit db38b9da68
3 changed files with 11 additions and 5 deletions
+1
View File
@@ -22,6 +22,7 @@
- [#469](https://github.com/estruyf/vscode-front-matter/issues/469): Fix for using the root folder as content folder
- [#470](https://github.com/estruyf/vscode-front-matter/issues/470): Fix `initialize project` dashboard description
- [#482](https://github.com/estruyf/vscode-front-matter/issues/482): Update the description when you want to overwrite the default content type description
- [#488](https://github.com/estruyf/vscode-front-matter/issues/488): Fix an issue where the `.frontmatter` folder gets created before initializing the project
- [#493](https://github.com/estruyf/vscode-front-matter/issues/493): Fix an issue where a custom placeholder value is replaced by an `array` instead of a `string`
## [8.2.0] - 2022-12-08 - [Release notes](https://beta.frontmatter.codes/updates/v8.2.0)
-3
View File
@@ -6,7 +6,6 @@ import { DashboardCommand } from '../dashboardWebView/DashboardCommand';
import { Extension } from '../helpers/Extension';
import { WebviewHelper } from '@estruyf/vscode';
import { DashboardData } from '../models/DashboardData';
import { MediaLibrary } from '../helpers/MediaLibrary';
import {
DashboardListener,
MediaListener,
@@ -45,8 +44,6 @@ export class Dashboard {
* Open or reveal the dashboard
*/
public static async open(data?: DashboardData) {
MediaLibrary.getInstance();
Dashboard._viewData = data;
if (Dashboard.isOpen) {
+10 -2
View File
@@ -5,7 +5,7 @@ import { join } from 'path';
import { Notifications } from '../helpers/Notifications';
import { Template } from './Template';
import { Folders } from './Folders';
import { FrameworkDetector, Logger, Settings } from '../helpers';
import { FrameworkDetector, Logger, MediaLibrary, Settings } from '../helpers';
import {
SETTING_CONTENT_DEFAULT_FILETYPE,
SETTING_TAXONOMY_CONTENT_TYPES,
@@ -29,7 +29,12 @@ categories: []
`;
public static isInitialized() {
return Settings.hasProjectFile();
const hasProjectFile = Settings.hasProjectFile();
// If it has a project file, initialize the media library
if (hasProjectFile) {
MediaLibrary.getInstance();
}
return hasProjectFile;
}
/**
@@ -48,6 +53,9 @@ categories: []
Notifications.info('Project initialized successfully.');
}
// Initialize the media library
MediaLibrary.getInstance();
Telemetry.send(TelemetryEvent.initialization);
// Check if you can find the framework