Skip to content

Commit a02dac8

Browse files
authored
Fix version printer to use app stdout and stderr (#395)
Added back in the change made in #166
1 parent e194e78 commit a02dac8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cmd/osv-scanner/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ func run(args []string, stdout, stderr io.Writer) int {
2424
var r reporter.Reporter
2525

2626
cli.VersionPrinter = func(ctx *cli.Context) {
27-
r = reporter.NewTableReporter(stdout, stderr, false)
27+
// Use the app Writer and ErrWriter since they will be the writers to keep parallel tests consistent
28+
r = reporter.NewTableReporter(ctx.App.Writer, ctx.App.ErrWriter, false)
2829
r.PrintText(fmt.Sprintf("osv-scanner version: %s\ncommit: %s\nbuilt at: %s\n", ctx.App.Version, commit, date))
2930
}
3031

0 commit comments

Comments
 (0)