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

Function promptForTemplateVariable

cli/templatepush.go:601–612  ·  view source on GitHub ↗
(inv *serpent.Invocation, variable codersdk.TemplateVersionVariable)

Source from the content-addressed store, hash-verified

599}
600
601func 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
614func displayVariableInfo(inv *serpent.Invocation, variable codersdk.TemplateVersionVariable) {
615 _, _ = fmt.Fprintf(inv.Stderr, "var.%s", cliui.Bold(variable.Name))

Callers 1

Calls 4

displayVariableInfoFunction · 0.85
promptForBoolVariableFunction · 0.85
promptForNumberVariableFunction · 0.85
promptForStringVariableFunction · 0.85

Tested by

no test coverage detected