Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2019-09-03 13:58:02 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2019-09-03 16:12:33 +0300
commit43298f028ccdf38e949b573d03d328bf96b998a3 (patch)
tree9f42576866df3d26e2aee674c2e2c6d28d4efbcb /modules/collect.go
parent1b5c7e327c7f98cf8e9fff920f3328198f67a598 (diff)
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
Diffstat (limited to 'modules/collect.go')
-rw-r--r--modules/collect.go7
1 files changed, 1 insertions, 6 deletions
diff --git a/modules/collect.go b/modules/collect.go
index 24b80a1d7..731a991b8 100644
--- a/modules/collect.go
+++ b/modules/collect.go
@@ -250,8 +250,7 @@ func (c *collector) add(owner *moduleAdapter, moduleImport Import, disabled bool
}
if moduleDir == "" {
-
- if c.GoModulesFilename != "" && c.isProbablyModule(modulePath) {
+ if c.GoModulesFilename != "" && isProbablyModule(modulePath) {
// Try to "go get" it and reload the module configuration.
if err := c.Get(modulePath); err != nil {
return nil, err
@@ -301,10 +300,6 @@ func (c *collector) add(owner *moduleAdapter, moduleImport Import, disabled bool
ma.path = modulePath
}
- if err := ma.validateAndApplyDefaults(c.fs); err != nil {
- return nil, err
- }
-
if !moduleImport.IgnoreConfig {
if err := c.applyThemeConfig(ma); err != nil {
return nil, err