Browse Source

Merge pull request #8 from jmccann/remove_cache

Delete .terraform cache
pull/11/head
Jack Spirou 9 years ago
parent
commit
07f6d863d4
  1. 10
      main.go

10
main.go

@ -38,12 +38,14 @@ func main() {
commands = append(commands, installCaCert(vargs.Cacert))
}
if remote.Backend != "" {
commands = append(commands, deleteCache())
commands = append(commands, remoteConfigCommand(remote))
}
commands = append(commands, planCommand(vargs.Vars))
if !vargs.Plan {
commands = append(commands, applyCommand())
}
commands = append(commands, deleteCache())
for _, c := range commands {
c.Env = os.Environ()
@ -72,6 +74,14 @@ func installCaCert(cacert string) *exec.Cmd {
)
}
func deleteCache() *exec.Cmd {
return exec.Command(
"rm",
"-rf",
".terraform",
)
}
func remoteConfigCommand(config remote) *exec.Cmd {
args := []string{
"remote",

Loading…
Cancel
Save