]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
commands: Fix case where languages cannot be configured
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Fri, 27 May 2022 11:34:20 +0000 (13:34 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Fri, 27 May 2022 11:34:20 +0000 (13:34 +0200)
There are some commands that needs to complete without a complete configuration.

commands/commandeer.go

index 444d7598711f722bea6f7c5a2a554a3404c1d43f..5e5e1b3ab97a8c158d01f61d135652782f57186f 100644 (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
        }