package app import ( "context" "fmt" "io" "gitea.maximumdirect.net/eric/distributor/internal/bundle" ) type ValidateOptions struct { Path string Stdout io.Writer } func Validate(ctx context.Context, options ValidateOptions) error { if options.Path == "" { return fmt.Errorf("validate command requires a path") } backend, err := newBackendFactory().openLocalPath(ctx, options.Path) if err != nil { return err } bundles, err := bundle.Discover(ctx, backend, "") if err != nil { return err } if options.Stdout != nil { _, err = fmt.Fprintf(options.Stdout, "Validated %d bundle(s)\n", len(bundles)) } return err }