mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 16:33:21 +01:00
* update build tags, ui support, and stereoscope, and release for windows support Signed-off-by: Christopher Angelo Phillips <christopher.phillips@anchore.com>
25 lines
693 B
Go
25 lines
693 B
Go
package ui
|
|
|
|
import (
|
|
"fmt"
|
|
"io"
|
|
|
|
syftEventParsers "github.com/anchore/syft/syft/event/parsers"
|
|
"github.com/wagoodman/go-partybus"
|
|
)
|
|
|
|
// handleCatalogerPresenterReady is a UI function for processing the CatalogerFinished bus event, displaying the catalog
|
|
// via the given presenter to stdout.
|
|
func handleCatalogerPresenterReady(event partybus.Event, reportOutput io.Writer) error {
|
|
// show the report to stdout
|
|
pres, err := syftEventParsers.ParsePresenterReady(event)
|
|
if err != nil {
|
|
return fmt.Errorf("bad CatalogerFinished event: %w", err)
|
|
}
|
|
|
|
if err := pres.Present(reportOutput); err != nil {
|
|
return fmt.Errorf("unable to show package catalog report: %w", err)
|
|
}
|
|
return nil
|
|
}
|