Skip to content

Commit fbb9e09

Browse files
committed
Improve code quality
1 parent 21a6fdd commit fbb9e09

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

Flow.Launcher.Core/Plugin/PluginConfig.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using Flow.Launcher.Plugin;
77
using System.Text.Json;
88
using CommunityToolkit.Mvvm.DependencyInjection;
9+
using Flow.Launcher.Infrastructure.UserSettings;
910

1011
namespace Flow.Launcher.Core.Plugin
1112
{
@@ -30,7 +31,7 @@ public static List<PluginMetadata> Parse(string[] pluginDirectories)
3031
// todo use linq when diable plugin is implmented since parallel.foreach + list is not thread saft
3132
foreach (var directory in directories)
3233
{
33-
if (File.Exists(Path.Combine(directory, "NeedDelete.txt")))
34+
if (File.Exists(Path.Combine(directory, DataLocation.PluginDeleteFile)))
3435
{
3536
try
3637
{

Flow.Launcher.Core/Plugin/PluginManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,7 @@ internal static async Task<bool> UninstallPluginAsync(PluginMetadata plugin, boo
815815
}
816816

817817
// Marked for deletion. Will be deleted on next start up
818-
using var _ = File.CreateText(Path.Combine(plugin.PluginDirectory, "NeedDelete.txt"));
818+
using var _ = File.CreateText(Path.Combine(plugin.PluginDirectory, DataLocation.PluginDeleteFile));
819819

820820
if (checkModified)
821821
{

Flow.Launcher.Infrastructure/UserSettings/DataLocation.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public static bool PortableDataLocationInUse()
4242
public const string PythonEnvironmentName = "Python";
4343
public const string NodeEnvironmentName = "Node.js";
4444
public const string PluginEnvironments = "Environments";
45+
public const string PluginDeleteFile = "NeedDelete.txt";
4546
public static string PluginEnvironmentsPath => Path.Combine(DataDirectory(), PluginEnvironments);
4647
}
4748
}

0 commit comments

Comments
 (0)