hugo

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

git clone git://git.shimmy1996.com/hugo.git
commit 56512e816fc88f90a7643526d93358fa4761200d
parent 3616fb629b33d8f2ac91eea77932e24076e31d1b
Author: Dimitri Merejkowsky <dmerejkowsky@users.noreply.github.com>
Date:   Sun,  9 Oct 2016 11:00:36 +0200

Allow to set cache dir in config file


Diffstat:
Mcommands/hugo.go | 5+++++
Mdocs/content/extras/datadrivencontent.md | 2++
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/commands/hugo.go b/commands/hugo.go
@@ -373,6 +373,11 @@ func InitializeConfig(subCmdVs ...*cobra.Command) error {
 	}
 
 	if cacheDir != "" {
+		viper.Set("CacheDir", cacheDir)
+	}
+
+	cacheDir = viper.GetString("cacheDir")
+	if cacheDir != "" {
 		if helpers.FilePathSeparator != cacheDir[len(cacheDir)-1:] {
 			cacheDir = cacheDir + helpers.FilePathSeparator
 		}
diff --git a/docs/content/extras/datadrivencontent.md b/docs/content/extras/datadrivencontent.md
@@ -103,6 +103,8 @@ temporary directory.
 With the command-line flag `--cacheDir`, you can specify any folder on
 your system as a caching directory.
 
+You can also set `cacheDir` in the main configuration file.
+
 If you don't like caching at all, you can fully disable caching with the
 command line flag `--ignoreCache`.