diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-09-03 12:58:02 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-09-03 15:12:33 +0200 |
commit | 43298f028ccdf38e949b573d03d328bf96b998a3 (patch) | |
tree | 9f42576866df3d26e2aee674c2e2c6d28d4efbcb /modules/client.go | |
parent | 1b5c7e327c7f98cf8e9fff920f3328198f67a598 (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/client.go')
-rw-r--r-- | modules/client.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/client.go b/modules/client.go index ae1a6a2b2..a743df5bd 100644 --- a/modules/client.go +++ b/modules/client.go @@ -279,12 +279,12 @@ func (c *Client) Init(path string) error { return nil } -func (c *Client) isProbablyModule(path string) bool { +func isProbablyModule(path string) bool { return module.CheckPath(path) == nil } func (c *Client) listGoMods() (goModules, error) { - if c.GoModulesFilename == "" { + if c.GoModulesFilename == "" || !c.moduleConfig.hasModuleImport() { return nil, nil } |