Make the "is this a Hugo Module" logic more lenient

Now we only try to load modules via Go if there is one or more modules imported in project config.

Fixes #6299
This commit is contained in:
Bjørn Erik Pedersen
2019-09-03 12:58:02 +02:00
parent 1b5c7e327c
commit 43298f028c
6 changed files with 40 additions and 30 deletions

View File

@@ -18,7 +18,6 @@ package modules
import (
"github.com/gohugoio/hugo/config"
"github.com/spf13/afero"
)
var _ Module = (*moduleAdapter)(nil)
@@ -173,24 +172,3 @@ func (m *moduleAdapter) Watch() bool {
return false
}
func (m *moduleAdapter) validateAndApplyDefaults(fs afero.Fs) error {
/*if len(m.modImport.Mounts) == 0 {
// Create default mount points for every component folder that
// exists in the module.
for _, componentFolder := range files.ComponentFolders {
sourceDir := filepath.Join(dir, componentFolder)
_, err := fs.Stat(sourceDir)
if err == nil {
m.modImport.Mounts = append(m.modImport.Mounts, Mount{
Source: componentFolder,
Target: componentFolder,
})
}
}
}*/
return nil
}