mirror of
https://github.com/flextype/flextype.git
synced 2025-08-14 17:14:22 +02:00
fix(plugins): fix issue with empty manifest and settings yaml files in plugins #538
This commit is contained in:
@@ -123,7 +123,7 @@ class Plugins
|
||||
|
||||
// Get default plugin settings content
|
||||
$defaultPluginSettingsFileContent = filesystem()->file($defaultPluginSettingsFile)->get();
|
||||
$defaultPluginSettings = flextype('serializers')->yaml()->decode($defaultPluginSettingsFileContent);
|
||||
$defaultPluginSettings = empty($defaultPluginSettingsFileContent) ? [] : flextype('serializers')->yaml()->decode($defaultPluginSettingsFileContent);
|
||||
|
||||
// Create project plugin settings file
|
||||
! filesystem()->file($projectPluginSettingsFile)->exists() and filesystem()->file($projectPluginSettingsFile)->put($defaultPluginSettingsFileContent);
|
||||
@@ -144,7 +144,7 @@ class Plugins
|
||||
|
||||
// Get default plugin manifest content
|
||||
$defaultPluginManifestFileContent = filesystem()->file($defaultPluginManifestFile)->get();
|
||||
$defaultPluginManifest = flextype('serializers')->yaml()->decode($defaultPluginManifestFileContent);
|
||||
$defaultPluginManifest = empty($defaultPluginManifestFileContent) ? [] : flextype('serializers')->yaml()->decode($defaultPluginManifestFileContent);
|
||||
|
||||
// Merge plugin settings and manifest data
|
||||
$plugins[$plugin['dirname']]['manifest'] = $defaultPluginManifest;
|
||||
|
Reference in New Issue
Block a user