(command string, envVars map[string]string, envVarTranslationMap map[string]string)
| 236 | } |
| 237 | |
| 238 | func executeCmd(command string, envVars map[string]string, envVarTranslationMap map[string]string) string { |
| 239 | cmd := exec.Command("bash", "-c", command) |
| 240 | // Might need to pass down module's translation map as well, |
| 241 | // currently only works in `zero apply` |
| 242 | cmd.Env = util.AppendProjectEnvToCmdEnv(envVars, os.Environ(), envVarTranslationMap) |
| 243 | out, err := cmd.Output() |
| 244 | flog.Debugf("Running command: %s", command) |
| 245 | if err != nil { |
| 246 | log.Fatalf("Failed to execute %v\n", err) |
| 247 | } |
| 248 | flog.Debugf("Command result: %s", string(out)) |
| 249 | return string(out) |
| 250 | } |
| 251 | |
| 252 | // aws cli prints output with linebreak in them |
| 253 | func sanitizeParameterValue(str string) string { |
no test coverage detected