mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-26 21:51:02 +03:00
commands: Make sure the hugo field is always initialized before it's used
Wrap the field to make it accessible after initialization. Fixes #6193
This commit is contained in:
parent
37f5929803
commit
ea9261e856
8 changed files with 54 additions and 40 deletions
|
@ -157,7 +157,7 @@ Also note that if you configure a positive maxAge for the "modules" file cache,
|
|||
return err
|
||||
}
|
||||
|
||||
_, err = com.hugo.FileCaches.ModulesCache().Prune(true)
|
||||
_, err = com.hugo().FileCaches.ModulesCache().Prune(true)
|
||||
return err
|
||||
|
||||
},
|
||||
|
@ -176,7 +176,7 @@ func (c *modCmd) withModsClient(failOnMissingConfig bool, f func(*modules.Client
|
|||
return err
|
||||
}
|
||||
|
||||
return f(com.hugo.ModulesClient)
|
||||
return f(com.hugo().ModulesClient)
|
||||
}
|
||||
|
||||
func (c *modCmd) initConfig(failOnNoConfig bool) (*commandeer, error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue