From 029cdb68f5d76efd697fb9561aec3bf0aa8fcefb Mon Sep 17 00:00:00 2001 From: Scott C Wilson Date: Sun, 12 Jul 2015 13:25:43 -0400 Subject: [PATCH] Checks to ensure theme directory, if specified, exists See #1234 --- commands/hugo.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/commands/hugo.go b/commands/hugo.go index cc4e19516..fabbaa51a 100644 --- 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)