Skip to content

Commit

Permalink
separate totalbar for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
vbauerster committed Jan 10, 2022
1 parent 9352fde commit e03dc8f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
3 changes: 1 addition & 2 deletions session.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,7 @@ func (s Session) makeProxyWriter(
return fmt.Sprintf("Total(%d/%d)", atomic.LoadUint32(partsDone), len(s.Parts))
}
bar := progress.New(s.ContentLength,
// mpb.BarStyle().Lbound(" ").Rbound(" ").Tip("<").Reverse(),
mpb.BarStyle().Lbound(" \x1b[36m").Rbound(" ").Tip(">\x1b[0m").TipOnComplete("=\x1b[0m"),
totalBarStyle(),
mpb.BarFillerTrim(),
mpb.PrependDecorators(
decor.Any(totalDecorator, decor.WCSyncWidthR),
Expand Down
9 changes: 9 additions & 0 deletions totalbar_posix.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//go:build !windows

package getparty

import "github.com/vbauerster/mpb/v7"

func totalBarStyle() mpb.BarFillerBuilder {
return mpb.BarStyle().Lbound(" \x1b[36m").Padding("\x1b[0m-").TipOnComplete("=\x1b[0m").Rbound(" ")
}
9 changes: 9 additions & 0 deletions totalbar_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//go:build windows

package getparty

import "github.com/vbauerster/mpb/v7"

func totalBarStyle() mpb.BarFillerBuilder {
return mpb.BarStyle().Lbound(" ").Rbound(" ")
}

0 comments on commit e03dc8f

Please sign in to comment.