diff --git a/Flow.Launcher.Core/Plugin/PluginConfig.cs b/Flow.Launcher.Core/Plugin/PluginConfig.cs index f7457b4e1..cba9e315d 100644 --- a/Flow.Launcher.Core/Plugin/PluginConfig.cs +++ b/Flow.Launcher.Core/Plugin/PluginConfig.cs @@ -6,6 +6,7 @@ using Flow.Launcher.Infrastructure; using Flow.Launcher.Plugin; using System.Text.Json; using CommunityToolkit.Mvvm.DependencyInjection; +using Flow.Launcher.Infrastructure.UserSettings; namespace Flow.Launcher.Core.Plugin { @@ -30,7 +31,7 @@ namespace Flow.Launcher.Core.Plugin // todo use linq when diable plugin is implmented since parallel.foreach + list is not thread saft foreach (var directory in directories) { - if (File.Exists(Path.Combine(directory, "NeedDelete.txt"))) + if (File.Exists(Path.Combine(directory, DataLocation.PluginDeleteFile))) { try { diff --git a/Flow.Launcher.Core/Plugin/PluginManager.cs b/Flow.Launcher.Core/Plugin/PluginManager.cs index 820e079cb..70cfc397f 100644 --- a/Flow.Launcher.Core/Plugin/PluginManager.cs +++ b/Flow.Launcher.Core/Plugin/PluginManager.cs @@ -815,7 +815,7 @@ namespace Flow.Launcher.Core.Plugin } // Marked for deletion. Will be deleted on next start up - using var _ = File.CreateText(Path.Combine(plugin.PluginDirectory, "NeedDelete.txt")); + using var _ = File.CreateText(Path.Combine(plugin.PluginDirectory, DataLocation.PluginDeleteFile)); if (checkModified) { diff --git a/Flow.Launcher.Infrastructure/UserSettings/DataLocation.cs b/Flow.Launcher.Infrastructure/UserSettings/DataLocation.cs index 9f8dfcb89..7f552a976 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/DataLocation.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/DataLocation.cs @@ -42,6 +42,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings public const string PythonEnvironmentName = "Python"; public const string NodeEnvironmentName = "Node.js"; public const string PluginEnvironments = "Environments"; + public const string PluginDeleteFile = "NeedDelete.txt"; public static string PluginEnvironmentsPath => Path.Combine(DataDirectory(), PluginEnvironments); } }