From: Dimitri Merejkowsky Date: Sun, 9 Oct 2016 09:00:36 +0000 (+0200) Subject: Allow to set cache dir in config file X-Git-Tag: v0.18~219 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=56512e81;p=brevno-suite%2Fhugo Allow to set cache dir in config file --- diff --git a/commands/hugo.go b/commands/hugo.go index 4c6a0597..4c284737 100644 --- a/commands/hugo.go +++ b/commands/hugo.go @@ -372,6 +372,11 @@ func InitializeConfig(subCmdVs ...*cobra.Command) error { viper.Set("LayoutDir", layoutDir) } + 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 index a1cef524..fc7e18cf 100644 --- 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`.