This commit is contained in:
@@ -309,13 +309,23 @@ struct ImageCommand: AsyncParsableCommand {
|
||||
case .installing: return "install"
|
||||
case .firstBoot: return "firstBoot"
|
||||
// Each provisioning step is its own headline — "installing Node.js"
|
||||
// should not erase "downloading gitea-runner".
|
||||
case .provisioning(let step): return "provisioning:\(step)"
|
||||
// should not erase "downloading gitea-runner" — but a step that carries
|
||||
// a live percentage keeps rewriting one line rather than scrolling a
|
||||
// hundred of them, so only the part before the payload identifies it.
|
||||
case .provisioning(let step): return "provisioning:\(Self.stableHead(of: step))"
|
||||
case .finalizing: return "finalizing"
|
||||
case .done: return "done"
|
||||
}
|
||||
}
|
||||
|
||||
/// The fixed part of a status line: everything before the two-space run that
|
||||
/// separates a headline from its payload, following the same convention as
|
||||
/// `installing macOS [====]`. A step with no payload is its own head.
|
||||
static func stableHead(of step: String) -> String {
|
||||
guard let separator = step.range(of: " ") else { return step }
|
||||
return String(step[step.startIndex..<separator.lowerBound])
|
||||
}
|
||||
|
||||
/// Renders a build stage as one status line.
|
||||
static func describe(_ stage: ImageBuildStage) -> String {
|
||||
switch stage {
|
||||
|
||||
Reference in New Issue
Block a user