From 58c3b73ff7d65078185e7072fbac379fc823021a Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Fri, 11 Apr 2025 22:13:58 +0800 Subject: [PATCH] Fix directory path issue --- Flow.Launcher.Infrastructure/Storage/BinaryStorage.cs | 6 +++--- .../Storage/FlowLauncherJsonStorage.cs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Flow.Launcher.Infrastructure/Storage/BinaryStorage.cs b/Flow.Launcher.Infrastructure/Storage/BinaryStorage.cs index 64f809181..8ff10816c 100644 --- a/Flow.Launcher.Infrastructure/Storage/BinaryStorage.cs +++ b/Flow.Launcher.Infrastructure/Storage/BinaryStorage.cs @@ -45,10 +45,10 @@ namespace Flow.Launcher.Infrastructure.Storage [Obsolete("This constructor is obsolete. Use BinaryStorage(string filename) instead.")] public BinaryStorage(string filename, string directoryPath = null!) { - directoryPath ??= DataLocation.CacheDirectory; - FilesFolders.ValidateDirectory(directoryPath); + DirectoryPath = directoryPath ?? DataLocation.CacheDirectory; + FilesFolders.ValidateDirectory(DirectoryPath); - FilePath = Path.Combine(directoryPath, $"{filename}{FileSuffix}"); + FilePath = Path.Combine(DirectoryPath, $"{filename}{FileSuffix}"); } public async ValueTask TryLoadAsync(T defaultData) diff --git a/Flow.Launcher.Infrastructure/Storage/FlowLauncherJsonStorage.cs b/Flow.Launcher.Infrastructure/Storage/FlowLauncherJsonStorage.cs index 8b4062b6b..ca78b2f20 100644 --- a/Flow.Launcher.Infrastructure/Storage/FlowLauncherJsonStorage.cs +++ b/Flow.Launcher.Infrastructure/Storage/FlowLauncherJsonStorage.cs @@ -17,11 +17,11 @@ namespace Flow.Launcher.Infrastructure.Storage public FlowLauncherJsonStorage() { - var directoryPath = Path.Combine(DataLocation.DataDirectory(), DirectoryName); - FilesFolders.ValidateDirectory(directoryPath); + DirectoryPath = Path.Combine(DataLocation.DataDirectory(), DirectoryName); + FilesFolders.ValidateDirectory(DirectoryPath); var filename = typeof(T).Name; - FilePath = Path.Combine(directoryPath, $"{filename}{FileSuffix}"); + FilePath = Path.Combine(DirectoryPath, $"{filename}{FileSuffix}"); } public new void Save()