command: make the default var-file flag easier
This commit is contained in:
parent
546865e1ee
commit
b5daa2f41e
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue