MCPcopy Index your code
hub / github.com/commitdev/zero / promptEnvironments

Function promptEnvironments

internal/apply/apply.go:168–186  ·  view source on GitHub ↗

promptEnvironments Prompts the user for the environments to apply against and returns a slice of strings representing the environments

()

Source from the content-addressed store, hash-verified

166
167// promptEnvironments Prompts the user for the environments to apply against and returns a slice of strings representing the environments
168func promptEnvironments() []string {
169 items := map[string][]string{
170 "Staging": {"stage"},
171 "Production": {"prod"},
172 }
173
174 labels := []string{"Staging", "Production"}
175
176 providerPrompt := promptui.Select{
177 Label: "Environments",
178 Items: labels,
179 }
180 _, providerResult, err := providerPrompt.Run()
181 if err != nil {
182 log.Fatalf("Prompt failed %v\n", err)
183 panic(err)
184 }
185 return items[providerResult]
186}
187
188func validateEnvironments(applyEnvironments []string) {
189 // Strict for now, we can brainstorm how much we want to support custom environments later

Callers 1

ApplyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected