mirror of
https://github.com/anchore/syft.git
synced 2025-11-18 00:43:20 +01:00
* chore(deps): update tools to latest versions Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix: update to new linter rules Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com> --------- Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com> Co-authored-by: spiffcs <32073428+spiffcs@users.noreply.github.com> Co-authored-by: Christopher Phillips <christopher.phillips@anchore.com>
25 lines
490 B
Go
25 lines
490 B
Go
package task
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/anchore/syft/internal/sbomsync"
|
|
"github.com/anchore/syft/syft/file"
|
|
"github.com/anchore/syft/syft/linux"
|
|
)
|
|
|
|
// TODO: add tui element here?
|
|
|
|
func NewEnvironmentTask() Task {
|
|
fn := func(_ context.Context, resolver file.Resolver, builder sbomsync.Builder) error {
|
|
release := linux.IdentifyRelease(resolver)
|
|
if release != nil {
|
|
builder.SetLinuxDistribution(*release)
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
return NewTask("environment-cataloger", fn)
|
|
}
|