config/module: can load a tree properly
This commit is contained in:
parent
e96fe43814
commit
85d1e40644
|
@ -4,5 +4,4 @@ package module
|
||||||
type Module struct {
|
type Module struct {
|
||||||
Name string
|
Name string
|
||||||
Source string
|
Source string
|
||||||
Dir string
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
# Hello
|
|
@ -69,7 +69,7 @@ func (t *Tree) Modules() []*Module {
|
||||||
result := make([]*Module, len(t.config.Modules))
|
result := make([]*Module, len(t.config.Modules))
|
||||||
for i, m := range t.config.Modules {
|
for i, m := range t.config.Modules {
|
||||||
result[i] = &Module{
|
result[i] = &Module{
|
||||||
Name: m.Name,
|
Name: m.Name,
|
||||||
Source: m.Source,
|
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.
|
// Go through all the modules and get the directory for them.
|
||||||
update := mode == GetModeUpdate
|
update := mode == GetModeUpdate
|
||||||
for i, m := range modules {
|
for i, m := range modules {
|
||||||
source, err := Detect(m.Source, m.Dir)
|
source, err := Detect(m.Source, t.config.Dir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("module %s: %s", m.Name, err)
|
return fmt.Errorf("module %s: %s", m.Name, err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue