diff --git a/config/module/module.go b/config/module/module.go index 6d01ed85d..f8649f6e9 100644 --- a/config/module/module.go +++ b/config/module/module.go @@ -4,5 +4,4 @@ package module type Module struct { Name string Source string - Dir string } diff --git a/config/module/test-fixtures/basic/foo/main.tf b/config/module/test-fixtures/basic/foo/main.tf new file mode 100644 index 000000000..fec56017d --- /dev/null +++ b/config/module/test-fixtures/basic/foo/main.tf @@ -0,0 +1 @@ +# Hello diff --git a/config/module/tree.go b/config/module/tree.go index 8cb5b967a..639a925b5 100644 --- a/config/module/tree.go +++ b/config/module/tree.go @@ -69,7 +69,7 @@ func (t *Tree) Modules() []*Module { result := make([]*Module, len(t.config.Modules)) for i, m := range t.config.Modules { result[i] = &Module{ - Name: m.Name, + Name: m.Name, Source: m.Source, } } @@ -101,7 +101,7 @@ func (t *Tree) Load(s Storage, mode GetMode) error { // Go through all the modules and get the directory for them. update := mode == GetModeUpdate for i, m := range modules { - source, err := Detect(m.Source, m.Dir) + source, err := Detect(m.Source, t.config.Dir) if err != nil { return fmt.Errorf("module %s: %s", m.Name, err) }