commands: Include theme name in version mismatch error

Fixes #5044
This commit is contained in:
Bjørn Erik Pedersen 2018-08-14 21:21:39 +02:00
parent c81fbf4625
commit e5052f4e09
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F
2 changed files with 7 additions and 5 deletions

View file

@ -17,6 +17,7 @@ import (
"os"
"path/filepath"
"regexp"
"strings"
"sync"
"time"
@ -324,11 +325,12 @@ func (c *commandeer) loadConfig(mustHaveConfigFile, running bool) error {
}
}
themeVersionMismatch, minVersion := c.isThemeVsHugoVersionMismatch(sourceFs)
dir, themeVersionMismatch, minVersion := c.isThemeVsHugoVersionMismatch(sourceFs)
if themeVersionMismatch {
cfg.Logger.ERROR.Printf("Current theme does not support Hugo version %s. Minimum version required is %s\n",
helpers.CurrentHugoVersion.ReleaseVersion(), minVersion)
name := filepath.Base(dir)
cfg.Logger.ERROR.Printf("%s theme does not support Hugo version %s. Minimum version required is %s\n",
strings.ToUpper(name), helpers.CurrentHugoVersion.ReleaseVersion(), minVersion)
}
return nil