From 348d977f09e75891ce31436319136083a836be19 Mon Sep 17 00:00:00 2001 From: Nikolay Edigaryev Date: Mon, 14 Feb 2022 16:54:36 +0300 Subject: [PATCH] VMConfig: save pretty-printed JSON --- Sources/tart/VMConfig.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/tart/VMConfig.swift b/Sources/tart/VMConfig.swift index 8af82c7..26cb6eb 100644 --- a/Sources/tart/VMConfig.swift +++ b/Sources/tart/VMConfig.swift @@ -28,7 +28,9 @@ struct VMConfig: Encodable, Decodable { } func save(toURL: URL) throws { - try JSONEncoder().encode(self).write(to: toURL) + let encoder = JSONEncoder() + encoder.outputFormatting = .prettyPrinted + try encoder.encode(self).write(to: toURL) } init(from decoder: Decoder) throws {