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:
Bjørn Erik Pedersen 2022-05-27 13:34:20 +02:00
parent 52edea0fec
commit 653ab2cc1f
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F

View file

@ -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
}