Skip to content

Commit 992ed9f

Browse files
authored
Adds public init for ExitStatus. (#305)
Client code may want to return ExitStatus from functions that return a containerization process return code, or -1 for caught exceptions.
1 parent cb6b78f commit 992ed9f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Sources/Containerization/ExitStatus.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,14 @@ public struct ExitStatus: Sendable {
2323
public var exitCode: Int32
2424
/// The timestamp when the process exited.
2525
public var exitedAt: Date
26+
27+
public init(exitCode: Int32) {
28+
self.exitCode = exitCode
29+
self.exitedAt = .now
30+
}
31+
32+
public init(exitCode: Int32, exitedAt: Date) {
33+
self.exitCode = exitCode
34+
self.exitedAt = exitedAt
35+
}
2636
}

0 commit comments

Comments
 (0)