diff --git a/Needlework.Net/Program.cs b/Needlework.Net/Program.cs index b7d77bf..fe693e8 100644 --- a/Needlework.Net/Program.cs +++ b/Needlework.Net/Program.cs @@ -115,8 +115,12 @@ class Program builder.AddSingleton(); builder.AddSingleton((_) => { - Directory.CreateDirectory("Data"); - return new SqlRawPersistentBlobCache("Data/data.sqlite"); + var appDataFolder = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); + appDataFolder = string.IsNullOrEmpty(appDataFolder) ? "AppData" : appDataFolder; + var appFolder = Path.Join(appDataFolder, AppInfo.Name); + Directory.CreateDirectory(appFolder); + var filePath = Path.Join(appFolder, "cache.sqlite"); + return new SqlRawPersistentBlobCache(filePath); }); builder.AddSingleton(new FlurlClientCache() .Add(FlurlClientKeys.GithubClient, "https://api.github.com")