mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
Allow to set cache dir in config file
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
3616fb629b
commit
56512e816f
@@ -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`.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user