add colored prefix to progress tracker bar so it's clearer what build an uploading file belongs to (#9780)
This commit is contained in:
parent
d74b47b734
commit
c88ff4ec45
|
@ -91,6 +91,10 @@ func (u *ColoredUi) Machine(t string, args ...string) {
|
||||||
u.Ui.Machine(t, args...)
|
u.Ui.Machine(t, args...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (u *ColoredUi) TrackProgress(src string, currentSize, totalSize int64, stream io.ReadCloser) io.ReadCloser {
|
||||||
|
return u.Ui.TrackProgress(u.colorize(src, u.Color, false), currentSize, totalSize, stream)
|
||||||
|
}
|
||||||
|
|
||||||
func (u *ColoredUi) colorize(message string, color UiColor, bold bool) string {
|
func (u *ColoredUi) colorize(message string, color UiColor, bold bool) string {
|
||||||
if !u.supportsColors() {
|
if !u.supportsColors() {
|
||||||
return message
|
return message
|
||||||
|
@ -172,7 +176,7 @@ func (u *TargetedUI) prefixLines(arrow bool, message string) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *TargetedUI) TrackProgress(src string, currentSize, totalSize int64, stream io.ReadCloser) io.ReadCloser {
|
func (u *TargetedUI) TrackProgress(src string, currentSize, totalSize int64, stream io.ReadCloser) io.ReadCloser {
|
||||||
return u.Ui.TrackProgress(src, currentSize, totalSize, stream)
|
return u.Ui.TrackProgress(u.prefixLines(false, src), currentSize, totalSize, stream)
|
||||||
}
|
}
|
||||||
|
|
||||||
// The BasicUI is a UI that reads and writes from a standard Go reader
|
// The BasicUI is a UI that reads and writes from a standard Go reader
|
||||||
|
|
Loading…
Reference in New Issue