Skip to content

Commit

Permalink
fix(envscan): flush buffer after print
Browse files Browse the repository at this point in the history
  • Loading branch information
iseki0 committed Jan 20, 2025
1 parent d26c43a commit 3f58f1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/murphy/internal/scan/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,10 +410,10 @@ func doSBOMOnlyPrint(ctx context.Context, task *model.ScanTask) {
}
var bufioWriter = bufio.NewWriter(writer)
var enc = json.NewEncoder(bufioWriter)
must.M(bufioWriter.Flush())
enc.SetIndent("", " ")
if task.Modules == nil {
task.Modules = make([]model.Module, 0)
}
must.M(enc.Encode(map[string]any{"modules": task.Modules}))
must.M(bufioWriter.Flush())
}

0 comments on commit 3f58f1f

Please sign in to comment.