-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathXcodeInstallState.swift
More file actions
49 lines (45 loc) · 1.25 KB
/
Copy pathXcodeInstallState.swift
File metadata and controls
49 lines (45 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//
// InstallState.swift
//
//
// Created by Matt Kiazyk on 2023-06-06.
//
import Foundation
@preconcurrency import Path
/// The installation state of an Xcode list item.
public enum XcodeInstallState: Equatable, Sendable {
/// The Xcode is available but not installed.
case notInstalled
/// The Xcode is currently moving through an installation step.
case installing(XcodeInstallationStep)
/// The Xcode is installed at the associated path.
case installed(Path)
/// Whether the state is ``notInstalled``.
public var notInstalled: Bool {
switch self {
case .notInstalled: return true
default: return false
}
}
/// Whether the state is ``installing(_:)``.
public var installing: Bool {
switch self {
case .installing: return true
default: return false
}
}
/// Whether the state is ``installed(_:)``.
public var installed: Bool {
switch self {
case .installed: return true
default: return false
}
}
/// The installed path when the state is ``installed(_:)``.
public var installedPath: Path? {
switch self {
case .installed(let path): return path
default: return nil
}
}
}