Improve code quality

This commit is contained in:
Jack251970 2025-09-21 16:19:13 +08:00
parent 21a6fdd100
commit fbb9e09237
3 changed files with 4 additions and 2 deletions

View file

@ -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
{

View file

@ -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)
{

View file

@ -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);
}
}