[PTRun] Build fix

This commit is contained in:
Gokce Kantarci
2024-01-16 15:03:54 +03:00
parent 497bc828a0
commit 3fb965f35d

View File

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