handle cases where ts package can't calculate the terminal width

This commit is contained in:
risk danger olson 2015-12-02 20:31:26 -07:00
parent 79e009034a
commit abd88a1c4c

@ -137,8 +137,12 @@ func (p *ProgressMeter) update() {
out += fmt.Sprintf(", %s skipped", formatBytes(p.skippedBytes))
}
padding := strings.Repeat(" ", width-len(out))
fmt.Fprintf(os.Stdout, out+padding)
padlen := width - len(out)
if 0 < padlen {
out += strings.Repeat(" ", padlen)
}
fmt.Fprintf(os.Stdout, out)
}
// progressLogger provides a wrapper around an os.File that can either