mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-24 00:32:51 +00: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
|
c.configFiles = configFiles
|
||||||
|
|
||||||
var ok bool
|
var ok bool
|
||||||
|
loc := time.Local
|
||||||
c.languages, ok = c.Cfg.Get("languagesSorted").(langs.Languages)
|
c.languages, ok = c.Cfg.Get("languagesSorted").(langs.Languages)
|
||||||
if !ok {
|
if ok {
|
||||||
panic("languages not configured")
|
loc = langs.GetLocation(c.languages[0])
|
||||||
}
|
}
|
||||||
|
|
||||||
err = c.initClock(langs.GetLocation(c.languages[0]))
|
err = c.initClock(loc)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue