From: Bjørn Erik Pedersen Date: Fri, 27 May 2022 11:34:20 +0000 (+0200) Subject: commands: Fix case where languages cannot be configured X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=653ab2cc1;p=brevno-suite%2Fhugo commands: Fix case where languages cannot be configured There are some commands that needs to complete without a complete configuration. --- diff --git a/commands/commandeer.go b/commands/commandeer.go index 444d75987..5e5e1b3ab 100644 --- a/commands/commandeer.go +++ b/commands/commandeer.go @@ -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 }