From e7da2d59f16a3673ac25013232ca03a66eefd752 Mon Sep 17 00:00:00 2001 From: Dmitry Kovba Date: Tue, 5 Aug 2025 12:29:26 -0700 Subject: [PATCH] Do not print task descriptions with disabled progress updates (#444) Fully resolves https://github.com/apple/container/issues/396. --- Sources/TerminalProgress/ProgressBar.swift | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/Sources/TerminalProgress/ProgressBar.swift b/Sources/TerminalProgress/ProgressBar.swift index 57c264cc..7273dfb3 100644 --- a/Sources/TerminalProgress/ProgressBar.swift +++ b/Sources/TerminalProgress/ProgressBar.swift @@ -62,16 +62,6 @@ public final class ProgressBar: Sendable { } } - private func printFullDescription() { - let (description, subDescription) = state.withLock { ($0.description, $0.subDescription) } - - if subDescription != "" { - standardError.write("\(description) \(subDescription)") - } else { - standardError.write(description) - } - } - /// Updates the description of the progress bar and increments the tasks by one. /// - Parameter description: The description of the action being performed. public func set(description: String) { @@ -82,9 +72,6 @@ public final class ProgressBar: Sendable { $0.subDescription = "" $0.tasks += 1 } - if config.disableProgressUpdates { - printFullDescription() - } } /// Updates the additional description of the progress bar. @@ -93,16 +80,9 @@ public final class ProgressBar: Sendable { resetCurrentTask() state.withLock { $0.subDescription = subDescription } - if config.disableProgressUpdates { - printFullDescription() - } } private func start(intervalSeconds: TimeInterval) async { - if config.disableProgressUpdates && !state.withLock({ $0.description.isEmpty }) { - printFullDescription() - } - while !state.withLock({ $0.finished }) { let intervalNanoseconds = UInt64(intervalSeconds * 1_000_000_000) render()