mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-26 21:51:02 +03:00
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:
parent
1b5c7e327c
commit
43298f028c
6 changed files with 40 additions and 30 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue