mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-02-23 19:49:43 +01:00
[PTRun] Build fix
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.IO.Abstractions;
|
||||
using System.Text.Encodings.Web;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace Wox.Infrastructure.Storage
|
||||
@@ -21,6 +22,11 @@ namespace Wox.Infrastructure.Storage
|
||||
|
||||
private string FilePath { get; set; } = string.Empty;
|
||||
|
||||
private static readonly JsonSerializerOptions _serializerOptions = new JsonSerializerOptions
|
||||
{
|
||||
WriteIndented = true,
|
||||
};
|
||||
|
||||
// As of now this information is not pertinent but may be in the future
|
||||
// There may be cases when we want to delete only the .cache files and not the .json storage files
|
||||
private enum StorageType
|
||||
@@ -157,7 +163,7 @@ namespace Wox.Infrastructure.Storage
|
||||
};
|
||||
|
||||
// Serialize the StorageObject to a JSON string
|
||||
string json = JsonSerializer.Serialize(dataToSerialize, new JsonSerializerOptions { WriteIndented = true });
|
||||
string json = JsonSerializer.Serialize(dataToSerialize, _serializerOptions);
|
||||
|
||||
// Write the JSON string to the file
|
||||
File.WriteAllText(FilePath, json);
|
||||
|
||||
Reference in New Issue
Block a user