Configure language & start language plugins (#400)
Build and Release / Read metadata (push) Has been cancelled
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg updater) (push) Has been cancelled
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis updater) (push) Has been cancelled
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-unknown-linux-gnu, linux-arm64, ubuntu-22.04-arm, aarch64-unknown-linux-gnu, deb) (push) Has been cancelled
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg updater) (push) Has been cancelled
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-pc-windows-msvc.exe, win-x64, windows-latest, x86_64-pc-windows-msvc, nsis updater) (push) Has been cancelled
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-unknown-linux-gnu, linux-x64, ubuntu-22.04, x86_64-unknown-linux-gnu, appimage deb updater) (push) Has been cancelled
Build and Release / Prepare & create release (push) Has been cancelled
Build and Release / Publish release (push) Has been cancelled

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2025-04-12 21:13:33 +02:00
1 parent 171ed37c27
commit 3fc15d9789
31 files changed
+612 -156

No files matched your search

@@ -10,6 +10,12 @@ public static partial class PluginFactory
{
public static async Task EnsureInternalPlugins()
{
if (!IS_INITIALIZED)
{
LOG.LogError("PluginFactory is not initialized. Please call Setup() before using it.");
return;
}
LOG.LogInformation("Start ensuring internal plugins.");
foreach (var plugin in Enum.GetValues<InternalPlugin>())
{
@@ -40,15 +46,15 @@ public static partial class PluginFactory
}
// Ensure that the additional resources exist:
foreach (var content in resourceFileProvider.GetDirectoryContents(metaData.ResourcePath))
foreach (var contentFilePath in resourceFileProvider.GetDirectoryContents(metaData.ResourcePath))
{
if(content.IsDirectory)
if(contentFilePath.IsDirectory)
{
LOG.LogError("The plugin contains a directory. This is not allowed.");
continue;
}
await CopyInternalPluginFile(content, metaData);
await CopyInternalPluginFile(contentFilePath, metaData);
}
}
catch
@@ -57,9 +63,9 @@ public static partial class PluginFactory
}
}
private static async Task CopyInternalPluginFile(IFileInfo resourceInfo, InternalPluginData metaData)
private static async Task CopyInternalPluginFile(IFileInfo resourceFilePath, InternalPluginData metaData)
{
await using var inputStream = resourceInfo.CreateReadStream();
await using var inputStream = resourceFilePath.CreateReadStream();
var pluginTypeBasePath = Path.Join(INTERNAL_PLUGINS_ROOT, metaData.Type.GetDirectory());
@@ -73,7 +79,7 @@ public static partial class PluginFactory
if (!Directory.Exists(pluginPath))
Directory.CreateDirectory(pluginPath);
var pluginFilePath = Path.Join(pluginPath, resourceInfo.Name);
var pluginFilePath = Path.Join(pluginPath, resourceFilePath.Name);
await using var outputStream = File.Create(pluginFilePath);
await inputStream.CopyToAsync(outputStream);