Skip to content

Commit

Permalink
fix issue #92: add progress bar
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilsk committed Aug 20, 2017
1 parent 7a425d4 commit fbc42ce
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
8 changes: 7 additions & 1 deletion cmd/semaphore/cli.go
Expand Up @@ -12,6 +12,7 @@ import (
"text/template"
"time"

"github.com/cheggaaa/pb"
"github.com/pkg/errors"
)

Expand Down Expand Up @@ -235,10 +236,15 @@ func (c *WaitCommand) Do() error {
task.Timeout = c.Timeout
}

var results = &Results{}
var (
bar = pb.StartNew(len(task.Jobs))
results = &Results{}
)
for result := range task.Run() {
bar.Increment()
results.Append(result)
}
bar.Finish()

for _, result := range results.Sort() {
var (
Expand Down
8 changes: 5 additions & 3 deletions cmd/semaphore/glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions cmd/semaphore/glide.yaml
Expand Up @@ -2,5 +2,7 @@ package: github.com/kamilsk/semaphore/cmd/semaphore
import:
- package: github.com/cheggaaa/pb
version: ^1.0.0
- package: github.com/mattn/go-runewidth
version: ^0.0.2
- package: github.com/pkg/errors
version: ^0.8.0

0 comments on commit fbc42ce

Please sign in to comment.