Made plugin root a static variable

This commit is contained in:
Thorsten Sommer 2025-03-23 12:36:52 +01:00
parent e10cf4171b
commit c375f11441
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
2 changed files with 4 additions and 4 deletions

View File

@ -59,11 +59,10 @@ public static partial class PluginFactory
{
await using var inputStream = resourceInfo.CreateReadStream();
var pluginsRoot = Path.Join(DATA_DIR, "plugins");
var pluginTypeBasePath = Path.Join(pluginsRoot, metaData.Type.GetDirectory());
var pluginTypeBasePath = Path.Join(PLUGINS_ROOT, metaData.Type.GetDirectory());
if (!Directory.Exists(pluginsRoot))
Directory.CreateDirectory(pluginsRoot);
if (!Directory.Exists(PLUGINS_ROOT))
Directory.CreateDirectory(PLUGINS_ROOT);
if (!Directory.Exists(pluginTypeBasePath))
Directory.CreateDirectory(pluginTypeBasePath);

View File

@ -8,6 +8,7 @@ public static partial class PluginFactory
{
private static readonly ILogger LOG = Program.LOGGER_FACTORY.CreateLogger("PluginFactory");
private static readonly string DATA_DIR = SettingsManager.DataDirectory!;
private static readonly string PLUGINS_ROOT = Path.Join(DATA_DIR, "plugins");
public static async Task LoadAll()
{