mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
commands: Fix case where languages cannot be configured
There are some commands that needs to complete without a complete configuration.
This commit is contained in:
parent
52edea0fec
commit
653ab2cc1f
1 changed files with 4 additions and 3 deletions
|
@ -369,12 +369,13 @@ func (c *commandeer) loadConfig() error {
|
|||
c.configFiles = configFiles
|
||||
|
||||
var ok bool
|
||||
loc := time.Local
|
||||
c.languages, ok = c.Cfg.Get("languagesSorted").(langs.Languages)
|
||||
if !ok {
|
||||
panic("languages not configured")
|
||||
if ok {
|
||||
loc = langs.GetLocation(c.languages[0])
|
||||
}
|
||||
|
||||
err = c.initClock(langs.GetLocation(c.languages[0]))
|
||||
err = c.initClock(loc)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue