Browse Source

Combine the --target append steps

No reason to waste lines
pull/30/head
Edwin.Avalos 8 years ago
parent
commit
714f421294
  1. 6
      plugin.go

6
plugin.go

@ -130,8 +130,7 @@ func planCommand(variables map[string]string, secrets map[string]string, paralle
"-out=plan.tfout", "-out=plan.tfout",
} }
for _, v := range targets { for _, v := range targets {
args = append(args, "--target") args = append(args, "--target", fmt.Sprintf("%s", v))
args = append(args, fmt.Sprintf("%s", v))
} }
for k, v := range variables { for k, v := range variables {
args = append(args, "-var") args = append(args, "-var")
@ -155,8 +154,7 @@ func applyCommand(parallelism int, targets []string) *exec.Cmd {
"apply", "apply",
} }
for _, v := range targets { for _, v := range targets {
args = append(args, "--target") args = append(args, "--target", fmt.Sprintf("%s", v))
args = append(args, fmt.Sprintf("%s", v))
} }
if parallelism > 0 { if parallelism > 0 {
args = append(args, fmt.Sprintf("-parallelism=%d", parallelism)) args = append(args, fmt.Sprintf("-parallelism=%d", parallelism))

Loading…
Cancel
Save