Skip to content

Commit 3f58f1f

Browse files
committed
fix(envscan): flush buffer after print
1 parent d26c43a commit 3f58f1f

File tree

1 file changed

+1
-1
lines changed
  • cmd/murphy/internal/scan

1 file changed

+1
-1
lines changed

cmd/murphy/internal/scan/cmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,10 +410,10 @@ func doSBOMOnlyPrint(ctx context.Context, task *model.ScanTask) {
410410
}
411411
var bufioWriter = bufio.NewWriter(writer)
412412
var enc = json.NewEncoder(bufioWriter)
413-
must.M(bufioWriter.Flush())
414413
enc.SetIndent("", " ")
415414
if task.Modules == nil {
416415
task.Modules = make([]model.Module, 0)
417416
}
418417
must.M(enc.Encode(map[string]any{"modules": task.Modules}))
418+
must.M(bufioWriter.Flush())
419419
}

0 commit comments

Comments
 (0)