mirror of
https://github.com/xtool-org/xtool.git
synced 2026-11-14 19:44:55 +03:00
723d61902d
Undo
20 lines
560 B
Swift
20 lines
560 B
Swift
public struct CommandVersion: Sendable, Hashable {
|
|
public var version: String
|
|
public var hasUncommittedChanges: Bool
|
|
|
|
public init(version: String, hasUncommittedChanges: Bool) {
|
|
self.version = version
|
|
self.hasUncommittedChanges = hasUncommittedChanges
|
|
}
|
|
|
|
public static var unversioned: Self {
|
|
.init(version: "unversioned", hasUncommittedChanges: true)
|
|
}
|
|
}
|
|
|
|
extension CommandVersion: CustomStringConvertible {
|
|
public var description: String {
|
|
version + (hasUncommittedChanges ? "-dirty" : "")
|
|
}
|
|
}
|