Skip to content

Commit 5e2e783

Browse files
authored
print progress on stdout only if --format text is used (#97)
1 parent 15efd7f commit 5e2e783

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: cli/firmware/flash.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,14 @@ func updateFirmware(board *firmwareindex.IndexBoard, loaderSketch, moduleName st
228228
return err
229229
}
230230
defer f.Close()
231-
f.SetProgressCallback(printProgress)
232231

233232
// now flash the actual firmware
234233
flasherOut := new(bytes.Buffer)
235234
flasherErr := new(bytes.Buffer)
236235
if feedback.GetFormat() == feedback.JSON {
237236
err = f.FlashFirmware(firmwareFile, flasherOut)
238237
} else {
238+
f.SetProgressCallback(printProgress)
239239
err = f.FlashFirmware(firmwareFile, os.Stdout)
240240
}
241241
if err != nil {

0 commit comments

Comments
 (0)