mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
Allow to set cache dir in config file
This commit is contained in:
parent
3616fb629b
commit
56512e816f
2 changed files with 7 additions and 0 deletions
|
@ -372,6 +372,11 @@ func InitializeConfig(subCmdVs ...*cobra.Command) error {
|
||||||
viper.Set("LayoutDir", layoutDir)
|
viper.Set("LayoutDir", layoutDir)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if cacheDir != "" {
|
||||||
|
viper.Set("CacheDir", cacheDir)
|
||||||
|
}
|
||||||
|
|
||||||
|
cacheDir = viper.GetString("cacheDir")
|
||||||
if cacheDir != "" {
|
if cacheDir != "" {
|
||||||
if helpers.FilePathSeparator != cacheDir[len(cacheDir)-1:] {
|
if helpers.FilePathSeparator != cacheDir[len(cacheDir)-1:] {
|
||||||
cacheDir = cacheDir + helpers.FilePathSeparator
|
cacheDir = cacheDir + helpers.FilePathSeparator
|
||||||
|
|
|
@ -103,6 +103,8 @@ temporary directory.
|
||||||
With the command-line flag `--cacheDir`, you can specify any folder on
|
With the command-line flag `--cacheDir`, you can specify any folder on
|
||||||
your system as a caching directory.
|
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
|
If you don't like caching at all, you can fully disable caching with the
|
||||||
command line flag `--ignoreCache`.
|
command line flag `--ignoreCache`.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue