VMConfig: save pretty-printed JSON

This commit is contained in:
Nikolay Edigaryev
2022-02-14 16:54:36 +03:00
parent 09a8109f4b
commit 348d977f09
+3 -1
View File
@@ -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 {