commit 029cdb68f5d76efd697fb9561aec3bf0aa8fcefb
parent a2fa3895eed9cb4bc6ef04e8eca047032d8bf8ba
Author: Scott C Wilson <scottcwilson@gmail.com>
Date: Sun, 12 Jul 2015 13:25:43 -0400
Checks to ensure theme directory, if specified, exists
See #1234
Diffstat:
1 file changed, 9 insertions(+), 0 deletions(-)
diff --git a/commands/hugo.go b/commands/hugo.go
@@ -278,7 +278,16 @@ func InitializeConfig() {
jww.INFO.Println("Using config file:", viper.ConfigFileUsed())
+ themeDir := helpers.GetThemeDir()
+ if themeDir != "" {
+ if _, err := os.Stat(themeDir); os.IsNotExist(err) {
+ jww.ERROR.Println("Unable to find theme Directory:", themeDir)
+ os.Exit(1)
+ }
+ }
+
themeVersionMismatch, minVersion := helpers.IsThemeVsHugoVersionMismatch()
+
if themeVersionMismatch {
jww.ERROR.Printf("Current theme does not support Hugo version %s. Minimum version required is %s\n",
helpers.HugoReleaseVersion(), minVersion)