MCPcopy Index your code
hub / github.com/rilldata/rill / start

Function start

cli/cmd/devtool/start.go:99–126  ·  view source on GitHub ↗
(ch *cmdutil.Helper, preset string, verbose, reset, refreshDotenv bool, services *servicesCfg)

Source from the content-addressed store, hash-verified

97}
98
99func start(ch *cmdutil.Helper, preset string, verbose, reset, refreshDotenv bool, services *servicesCfg) error {
100 ctx := graceful.WithCancelOnTerminate(context.Background())
101
102 err := errors.Join(
103 checkGoVersion(),
104 checkNodeVersion(ctx),
105 checkDocker(ctx),
106 checkRillRepo(),
107 )
108 if err != nil {
109 return err
110 }
111
112 switch preset {
113 case "cloud", "minimal", "e2e", "other":
114 err = cloud{}.start(ctx, ch, verbose, reset, refreshDotenv, preset, services)
115 case "local":
116 err = local{}.start(ctx, verbose, reset, services)
117 default:
118 err = fmt.Errorf("unknown preset %q", preset)
119 }
120 // If ctx.Err() != nil, we don't return the err because any graceful shutdown will cause sub-commands to return non-zero exit code errors.
121 // In these cases, ignoring the error doesn't really matter since "real" errors are probably also logged to stdout anyway.
122 if err != nil && (ctx.Err() == nil || verbose) {
123 return err
124 }
125 return nil
126}
127
128func checkGoVersion() error {
129 v := version.Must(version.NewVersion(strings.TrimPrefix(runtime.Version(), "go")))

Callers 1

StartCmdFunction · 0.70

Calls 8

WithCancelOnTerminateFunction · 0.92
checkGoVersionFunction · 0.85
checkNodeVersionFunction · 0.85
checkDockerFunction · 0.85
checkRillRepoFunction · 0.85
startMethod · 0.65
ErrorfMethod · 0.65
ErrMethod · 0.65

Tested by

no test coverage detected