missing args assignment after parsing flags

`env list` was missing the args re-assignment after parsing the flags.
This is only a problem if the variables are automatically be populated
as arguments from a tfvars file.
This commit is contained in:
James Bardin 2017-03-03 18:19:56 -05:00
parent a2d78b62aa
commit e58a02405e
2 changed files with 11 additions and 0 deletions

View File

@ -64,6 +64,16 @@ func TestEnv_createAndList(t *testing.T) {
defer os.RemoveAll(td) defer os.RemoveAll(td)
defer testChdir(t, td)() defer testChdir(t, td)()
// make sure a vars file doesn't interfere
err := ioutil.WriteFile(
DefaultVarsFilename,
[]byte(`foo = "bar"`),
0644,
)
if err != nil {
t.Fatal(err)
}
newCmd := &EnvNewCommand{} newCmd := &EnvNewCommand{}
envs := []string{"test_a", "test_b", "test_c"} envs := []string{"test_a", "test_b", "test_c"}

View File

@ -19,6 +19,7 @@ func (c *EnvListCommand) Run(args []string) int {
return 1 return 1
} }
args = cmdFlags.Args()
configPath, err := ModulePath(args) configPath, err := ModulePath(args)
if err != nil { if err != nil {
c.Ui.Error(err.Error()) c.Ui.Error(err.Error())