MCPcopy Index your code
hub / github.com/coder/coder / displayAppliedPreset

Function displayAppliedPreset

cli/create.go:550–560  ·  view source on GitHub ↗

displayAppliedPreset shows the user which preset was applied and its parameters

(inv *serpent.Invocation, preset *codersdk.Preset, parameters []codersdk.WorkspaceBuildParameter)

Source from the content-addressed store, hash-verified

548
549// displayAppliedPreset shows the user which preset was applied and its parameters
550func displayAppliedPreset(inv *serpent.Invocation, preset *codersdk.Preset, parameters []codersdk.WorkspaceBuildParameter) {
551 label := fmt.Sprintf("Preset '%s'", preset.Name)
552 if preset.Default {
553 label += " (default)"
554 }
555
556 _, _ = fmt.Fprintf(inv.Stdout, "%s applied:\n", cliui.Bold(label))
557 for _, param := range parameters {
558 _, _ = fmt.Fprintf(inv.Stdout, " %s: '%s'\n", cliui.Bold(param.Name), param.Value)
559 }
560}
561
562// prepWorkspaceBuild will ensure a workspace build will succeed on the latest template version.
563// Any missing params will be prompted to the user. It supports rich parameters.

Callers 1

CreateMethod · 0.85

Calls 1

BoldFunction · 0.92

Tested by

no test coverage detected