Skip to content

Commit 264385f

Browse files
authored
Merge pull request #45 from elyscape/fix-json-output
Fix JSON output
2 parents f380a7b + f816622 commit 264385f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Sources/CoreLocationCLI/main.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ class Delegate: NSObject, CLLocationManagerDelegate {
9090

9191
switch format {
9292
case .json:
93-
print(try! JSONEncoder().encode(formattedParts))
93+
let output = try! JSONEncoder().encode(formattedParts)
94+
print(String(data: output, encoding: .utf8)!)
9495
case .string(let output):
9596
print(formattedParts.reduce(output, { partialResult, keyValuePair in
9697
partialResult.replacingOccurrences(of: "%\(keyValuePair.key)", with: keyValuePair.value ?? "")

0 commit comments

Comments
 (0)