diff --git a/Package.swift b/Package.swift index a4972d3..ad7f2ee 100644 --- a/Package.swift +++ b/Package.swift @@ -6,7 +6,7 @@ import PackageDescription let package = Package( name: "hyper-focus", platforms: [ - .macOS(.v10_15), + .macOS(.v12), ], dependencies: [ .package(url: "https://github.com/envoy/Ambassador", from: "4.0.0"), diff --git a/Sources/hyper-focus/configuration_loader.swift b/Sources/hyper-focus/configuration_loader.swift index 563f2b4..62ca873 100644 --- a/Sources/hyper-focus/configuration_loader.swift +++ b/Sources/hyper-focus/configuration_loader.swift @@ -21,7 +21,13 @@ enum ConfigurationLoader { debug("Loading configuration from \(configPath!.absoluteString)") let configData = try! Data(contentsOf: configPath!) - let config = try! JSONDecoder().decode(Configuration.self, from: configData) + + // neat! Apple supports JSON5, which allows for comments + // https://developer.apple.com/documentation/foundation/jsondecoder/3766916-allowsjson5 + let decoder = JSONDecoder() + decoder.allowsJSON5 = true + + let config = try! decoder.decode(Configuration.self, from: configData) return config }