File tree 2 files changed +8
-9
lines changed
2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -222,14 +222,13 @@ You can now refer to the added file in a gateway, like so:
222
222
return
223
223
}
224
224
225
- var showProgressBar bool
226
- if ! progress && ! quiet && ! silent {
227
- showProgressBar = true
225
+ if ! quiet && ! silent {
226
+ progress = true
228
227
}
229
228
230
229
var bar * pb.ProgressBar
231
230
var terminalWidth int
232
- if showProgressBar {
231
+ if progress {
233
232
bar = pb .New64 (0 ).SetUnits (pb .U_BYTES )
234
233
bar .ManualUpdate = true
235
234
bar .Start ()
@@ -264,7 +263,7 @@ You can now refer to the added file in a gateway, like so:
264
263
}
265
264
output := out .(* coreunix.AddedObject )
266
265
if len (output .Hash ) > 0 {
267
- if showProgressBar {
266
+ if progress {
268
267
// clear progress bar line before we print "added x" output
269
268
fmt .Fprintf (res .Stderr (), "\033 [2K\r " )
270
269
}
@@ -277,7 +276,7 @@ You can now refer to the added file in a gateway, like so:
277
276
} else {
278
277
log .Debugf ("add progress: %v %v\n " , output .Name , output .Bytes )
279
278
280
- if ! showProgressBar {
279
+ if ! progress {
281
280
continue
282
281
}
283
282
@@ -293,11 +292,11 @@ You can now refer to the added file in a gateway, like so:
293
292
totalProgress = bar .Add64 (delta )
294
293
}
295
294
296
- if showProgressBar {
295
+ if progress {
297
296
bar .Update ()
298
297
}
299
298
case size := <- sizeChan :
300
- if showProgressBar {
299
+ if progress {
301
300
bar .Total = size
302
301
bar .ShowPercent = true
303
302
bar .ShowBar = true
Original file line number Diff line number Diff line change @@ -360,7 +360,7 @@ test_add_cat_5MB
360
360
361
361
test_add_cat_expensive
362
362
363
- test_add_named_pipe " Post http://$API_ADDR /api/v0/add?encoding=json&progress=true& r=true&stream-channels=true:"
363
+ test_add_named_pipe " Post http://$API_ADDR /api/v0/add?encoding=json&r=true&stream-channels=true:"
364
364
365
365
test_kill_ipfs_daemon
366
366
You can’t perform that action at this time.
0 commit comments