commands: Ignore "module does not exist" errors in hugo mod init

Closes #11458
This commit is contained in:
Bjørn Erik Pedersen
2024-09-19 10:53:39 +02:00
parent c260cb28a9
commit e363964f2f
10 changed files with 92 additions and 50 deletions

View File

@@ -699,6 +699,9 @@ func (c *collector) normalizeMounts(owner *moduleAdapter, mounts []Mount) ([]Mou
}
func (c *collector) wrapModuleNotFound(err error) error {
if c.Client.ccfg.IgnoreModuleDoesNotExist {
return nil
}
err = fmt.Errorf(err.Error()+": %w", ErrNotExist)
if c.GoModulesFilename == "" {
return err