INNER CODE UNIT · Go
run
cli/cli · .github/skills/cli-exercise/tool/internal/preflight/main.go:114
func run(ctx context.Context, root string, options cliOptions, streams cliutil.Streams, factory func(string, options) (*service, error)) (int, error) {
service, err := factory(root, options.selections)
if err != nil {
return emit(blocked(err.Error()), options.output, streams)
}
value, err := service.check(ctx)
if err != nil {
value = blocked(err.Error())
}
return emit(value, options.output, streams)
}
func blocked(message string) report {
return report{SchemaVersion: 1, Status: "blocked", Issues: []issue{{Item: "preflight", Detail: message}}}
}
// Main checks selected prerequisites without installing or modifying dependencies.
func Main(ctx context.Context, skillRoot string, args []string, streams cliutil.Streams) int {