Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PIF workspace and project paths may not be present #64

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions PIF/Sources/PIFSupport/PIF.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public enum PIF {
public final class Workspace: Decodable {
public let guid: GUID
public let name: String
public let path: URL
public let path: URL?
public let projects: [Project]

private enum CodingKeys: CodingKey {
Expand All @@ -94,7 +94,7 @@ public enum PIF {

guid = try container.decode(GUID.self, forKey: .guid)
name = try container.decode(String.self, forKey: .name)
path = try container.decode(URL.self, forKey: .path)
path = try container.decodeIfPresent(URL.self, forKey: .path)

let projectPaths = try container.decode([String].self, forKey: .projects)
.map {
Expand Down Expand Up @@ -124,7 +124,7 @@ public enum PIF {
public final class Project: Decodable {
public let guid: GUID
public let projectName: String?
public let path: URL
public let path: URL?
public let projectDirectory: URL
public let developmentRegion: String?
public let buildConfigurations: [BuildConfiguration]
Expand All @@ -143,7 +143,7 @@ public enum PIF {

guid = try container.decode(GUID.self, forKey: .guid)
projectName = try container.decodeIfPresent(String.self, forKey: .projectName)
path = try container.decode(URL.self, forKey: .path)
path = try container.decodeIfPresent(URL.self, forKey: .path)
projectDirectory = try container.decode(URL.self, forKey: .projectDirectory)
developmentRegion = try container.decodeIfPresent(String.self, forKey: .developmentRegion)
buildConfigurations = try container.decode([BuildConfiguration].self, forKey: .buildConfigurations)
Expand Down
Loading