Skip to content

Commit

Permalink
Log number of packages scanned from SBOMs. (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverchang authored Feb 1, 2023
1 parent 25bdc68 commit 55ea023
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/osvscanner/osvscanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,19 +125,21 @@ func scanSBOMFile(r *output.Reporter, query *osv.BatchedQuery, path string) erro
// Skip if this isn't the case to avoid panics
continue
}
count := 0
err := provider.GetPackages(file, func(id sbom.Identifier) error {
purlQuery := osv.MakePURLRequest(id.PURL)
purlQuery.Source = models.SourceInfo{
Path: path,
Type: "sbom",
}
query.Queries = append(query.Queries, purlQuery)
count++

return nil
})
if err == nil {
// Found the right format.
r.PrintText(fmt.Sprintf("Scanned %s SBOM\n", provider.Name()))
r.PrintText(fmt.Sprintf("Scanned %s SBOM and found %d packages\n", provider.Name(), count))
return nil
}

Expand Down

0 comments on commit 55ea023

Please sign in to comment.