mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-09 22:39:53 +00:00
Fix: progress bar sometimes doesn't disappear.
This commit is contained in:
+4
-3
@@ -64,7 +64,6 @@ func (p *Progress) InitBar(count int64, isBytes bool) {
|
|||||||
p.bar.SetUnits(pb.U_BYTES)
|
p.bar.SetUnits(pb.U_BYTES)
|
||||||
p.bar.ShowSpeed = true
|
p.bar.ShowSpeed = true
|
||||||
}
|
}
|
||||||
p.barShown = false
|
|
||||||
p.bar.Start()
|
p.bar.Start()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -111,8 +110,10 @@ func (p *Progress) worker() {
|
|||||||
}
|
}
|
||||||
fmt.Print(task.message)
|
fmt.Print(task.message)
|
||||||
case codeProgress:
|
case codeProgress:
|
||||||
fmt.Print("\r" + task.message)
|
if p.bar != nil {
|
||||||
p.barShown = true
|
fmt.Print("\r" + task.message)
|
||||||
|
p.barShown = true
|
||||||
|
}
|
||||||
case codeHideProgress:
|
case codeHideProgress:
|
||||||
if p.barShown {
|
if p.barShown {
|
||||||
fmt.Print("\r\033[2K")
|
fmt.Print("\r\033[2K")
|
||||||
|
|||||||
Reference in New Issue
Block a user