displayAppliedPreset shows the user which preset was applied and its parameters
(inv *serpent.Invocation, preset *codersdk.Preset, parameters []codersdk.WorkspaceBuildParameter)
| 548 | |
| 549 | // displayAppliedPreset shows the user which preset was applied and its parameters |
| 550 | func 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. |