Skip to content

Commit

Permalink
fix: honor quiet flag in diff logic (#1168)
Browse files Browse the repository at this point in the history
  • Loading branch information
didroe authored Aug 2, 2023
1 parent f8c0e00 commit cd3e7ec
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions pkg/commands/artifact/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,10 @@ func (r *runner) Scan(ctx context.Context, opts flag.Options) (*basebranchfindin

var baseBranchFindings *basebranchfindings.Findings
if err := repository.WithBaseBranch(func() error {
output.StdErrLog(fmt.Sprintf(
"\nScanning base branch %s",
opts.DiffBaseBranch,
))
if !opts.Quiet {
output.StdErrLog(fmt.Sprintf("\nScanning base branch %s", opts.DiffBaseBranch))
}

if err := orchestrator.Scan(r.reportPath+".base", fileList.BaseFiles); err != nil {
return err
}
Expand All @@ -204,7 +204,10 @@ func (r *runner) Scan(ctx context.Context, opts flag.Options) (*basebranchfindin

baseBranchFindings = buildBaseBranchFindings(fileList, detections)

output.StdErrLog("\nScanning current branch")
if !opts.Quiet {
output.StdErrLog("\nScanning current branch")
}

return nil
}); err != nil {
return nil, err
Expand Down

0 comments on commit cd3e7ec

Please sign in to comment.