diff --git a/Sources/ProjectSpec/Decoding.swift b/Sources/ProjectSpec/Decoding.swift index ad448f02..7f53ffc0 100644 --- a/Sources/ProjectSpec/Decoding.swift +++ b/Sources/ProjectSpec/Decoding.swift @@ -53,6 +53,10 @@ extension JSONObjectConvertible { public init(path: Path) throws { let content: String = try path.read() + if content == "" { + try self.init(jsonDictionary: [:]) + return + } let yaml = try Yams.load(yaml: content) guard let jsonDictionary = yaml as? JSONDictionary else { throw JSONUtilsError.fileNotAJSONDictionary