Documentation
¶
Overview ¶
cmd/product/run/run.go
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RunCmd = &cobra.Command{ Use: "run", Example: ` contextvibes product run`, RunE: func(cmd *cobra.Command, args []string) error { presenter := ui.NewPresenter(cmd.OutOrStdout(), cmd.ErrOrStderr()) ctx := cmd.Context() presenter.Header("--- Example Runner ---") examples, err := findRunnableExamples(".") if err != nil { return err } if len(examples) == 0 { presenter.Warning("No runnable examples found in the './examples' directory.") return nil } choice, err := presenter.PromptForSelect("Please select an example to run:", examples) if err != nil || choice == "" { return nil } if err := runVerificationChecks(ctx, presenter, globals.ExecClient, globals.LoadedAppConfig, choice); err != nil { return errors.New("prerequisite verification failed") } presenter.Newline() presenter.Step("Executing example: %s...", presenter.Highlight(choice)) err = globals.ExecClient.Execute(ctx, ".", "go", "run", "./"+choice) if err != nil { return errors.New("example execution failed") } globals.AppLogger.InfoContext(ctx, "Successfully launched example", "example_path", choice) return nil }, }
RunCmd represents the run command.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.