hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit 653ab2cc1f97df8f05c466e1d757e1c81fcc58f8
parent 52edea0feccf98700300e98567c5a2ada7604c89
Author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Date:   Fri, 27 May 2022 13:34:20 +0200

commands: Fix case where languages cannot be configured

There are some commands that needs to complete without a complete configuration.

Diffstat:
Mcommands/commandeer.go | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git 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
 	}