Fix typeo, format settings

This commit is contained in:
Timothy Baldridge 2021-11-09 22:24:44 -07:00
parent f7d81a6f4e
commit 40e7211b34
2 changed files with 7 additions and 3 deletions

View File

@ -71,9 +71,9 @@ public static class ServiceExtensions
service.AddAllSingleton<IResource, IResource<HttpClient>>(s => new Resource<HttpClient>("Web Requests", GetSettings(s, "Web Requests")));
service.AddAllSingleton<IResource, IResource<Context>>(s => new Resource<Context>("VFS", GetSettings(s, "VFS")));
service.AddAllSingleton<IResource, IResource<FileHashCache>>(s =>
new Resource<FileHashCache>("File Hashing", GetSettings(s, "FileHashing")));
new Resource<FileHashCache>("File Hashing", GetSettings(s, "File Hashing")));
service.AddAllSingleton<IResource, IResource<FileExtractor.FileExtractor>>(s =>
new Resource<FileExtractor.FileExtractor>("File Extractor", GetSettings(s, "FileExtractor")));
new Resource<FileExtractor.FileExtractor>("File Extractor", GetSettings(s, "File Extractor")));
service.AddAllSingleton<IResource, IResource<ACompiler>>(s =>
new Resource<ACompiler>("Compiler", GetSettings(s, "Compiler")));

View File

@ -35,7 +35,11 @@ public class SettingsManager
var tmp = GetPath(key).WithExtension(Ext.Temp);
await using (var s = tmp.Open(FileMode.Create, FileAccess.Write))
{
await JsonSerializer.SerializeAsync(s, value, _dtos.Options);
var opts = new JsonSerializerOptions(_dtos.Options)
{
WriteIndented = true
};
await JsonSerializer.SerializeAsync(s, value, opts);
}
await tmp.MoveToAsync(GetPath(key), true, CancellationToken.None);