ref: 029cdb68f5d76efd697fb9561aec3bf0aa8fcefb
parent: a2fa3895eed9cb4bc6ef04e8eca047032d8bf8ba
author: Scott C Wilson <[email protected]>
date: Sun Jul 12 09:25:43 EDT 2015
Checks to ensure theme directory, if specified, exists See #1234
--- a/commands/hugo.go
+++ b/commands/hugo.go
@@ -278,7 +278,16 @@
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)