Skip to content

Commit

Permalink
Checkpoint
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Kevin Atkinson <[email protected]>
  • Loading branch information
kevina committed Feb 12, 2017
1 parent 0dd3e8b commit 3f02784
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions core/commands/pin.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,23 @@ var addPinCmd = &cmds.Command{
if !ok {
return nil, u.ErrCast()
}
progressLine := false
for r0 := range ch {
r := r0.(*AddPinOutput)
if r.Progress == -1 || r.Pins != nil {
added = r.Pins
} else {
fmt.Fprintf(res.Stderr(), "Fetched/Processed %d nodes\n", r.Progress)
if progressLine {
fmt.Fprintf(res.Stderr(), "\r")
}
fmt.Fprintf(res.Stderr(), "Fetched/Processed %d nodes", r.Progress)
progressLine = true
}
}
if progressLine {
fmt.Fprintf(res.Stderr(), "\n")
}
}

var pintype string
rec, found, _ := res.Request().Option("recursive").Bool()
if rec || !found {
Expand Down

0 comments on commit 3f02784

Please sign in to comment.