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

Function getModuleOperationCommand

internal/apply/apply.go:137–165  ·  view source on GitHub ↗
(mod moduleconfig.ModuleConfig, operation string)

Source from the content-addressed store, hash-verified

135}
136
137func getModuleOperationCommand(mod moduleconfig.ModuleConfig, operation string) (operationCommand []string) {
138 defaultCheck := []string{"make", "check"}
139 defaultApply := []string{"make"}
140 defaultSummary := []string{"make", "summary"}
141
142 switch operation {
143 case "check":
144 if mod.Commands.Check != "" {
145 operationCommand = []string{"sh", "-c", mod.Commands.Check}
146 } else {
147 operationCommand = defaultCheck
148 }
149 case "apply":
150 if mod.Commands.Apply != "" {
151 operationCommand = []string{"sh", "-c", mod.Commands.Apply}
152 } else {
153 operationCommand = defaultApply
154 }
155 case "summary":
156 if mod.Commands.Summary != "" {
157 operationCommand = []string{"sh", "-c", mod.Commands.Summary}
158 } else {
159 operationCommand = defaultSummary
160 }
161 default:
162 panic("Unexpected operation")
163 }
164 return operationCommand
165}
166
167// promptEnvironments Prompts the user for the environments to apply against and returns a slice of strings representing the environments
168func promptEnvironments() []string {

Callers 1

modulesWalkCmdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected