MCPcopy Create free account
hub / github.com/rilldata/rill / checkNodeVersion

Function checkNodeVersion

cli/cmd/devtool/start.go:137–150  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

135}
136
137func checkNodeVersion(ctx context.Context) error {
138 out, err := newCmd(ctx, "node", "--version").Output()
139 if err != nil {
140 return fmt.Errorf("error executing the 'node --version' command: %w", err)
141 }
142
143 v := version.Must(version.NewVersion(strings.TrimSpace(string(out))))
144 minVersion := version.Must(version.NewVersion(minNodeVersion))
145 if v.LessThan(minVersion) {
146 return fmt.Errorf("node.js version %s or higher is required", minNodeVersion)
147 }
148
149 return nil
150}
151
152func checkDocker(ctx context.Context) error {
153 out, err := newCmd(ctx, "docker", "info", "--format", "json").Output()

Callers 1

startFunction · 0.85

Calls 2

newCmdFunction · 0.85
ErrorfMethod · 0.65

Tested by

no test coverage detected