(inv *serpent.Invocation, variable codersdk.TemplateVersionVariable)
| 599 | } |
| 600 | |
| 601 | func promptForTemplateVariable(inv *serpent.Invocation, variable codersdk.TemplateVersionVariable) (string, error) { |
| 602 | displayVariableInfo(inv, variable) |
| 603 | |
| 604 | switch variable.Type { |
| 605 | case "bool": |
| 606 | return promptForBoolVariable(inv, variable) |
| 607 | case "number": |
| 608 | return promptForNumberVariable(inv, variable) |
| 609 | default: |
| 610 | return promptForStringVariable(inv, variable) |
| 611 | } |
| 612 | } |
| 613 | |
| 614 | func displayVariableInfo(inv *serpent.Invocation, variable codersdk.TemplateVersionVariable) { |
| 615 | _, _ = fmt.Fprintf(inv.Stderr, "var.%s", cliui.Bold(variable.Name)) |
no test coverage detected