command: make the default var-file flag easier

This commit is contained in:
Mitchell Hashimoto 2014-09-08 20:57:08 -07:00
parent 546865e1ee
commit b5daa2f41e
1 changed files with 1 additions and 2 deletions

View File

@ -5,7 +5,6 @@ import (
"flag" "flag"
"fmt" "fmt"
"io" "io"
"math/rand"
"os" "os"
"github.com/hashicorp/terraform/config" "github.com/hashicorp/terraform/config"
@ -190,7 +189,7 @@ func (m *Meta) process(args []string, vars bool) []string {
m.autoKey = "" m.autoKey = ""
if vars { if vars {
if _, err := os.Stat(DefaultVarsFilename); err == nil { if _, err := os.Stat(DefaultVarsFilename); err == nil {
m.autoKey = fmt.Sprintf("var-file-%d", rand.Int()) m.autoKey = "var-file-default"
args = append(args, "", "") args = append(args, "", "")
copy(args[2:], args[0:]) copy(args[2:], args[0:])
args[0] = "-" + m.autoKey args[0] = "-" + m.autoKey