Allow to set cache dir in config file

This commit is contained in:
Dimitri Merejkowsky authored and Bjørn Erik Pedersen committed 2016-10-09 11:00:36 +02:00
1 parent 3616fb629b
commit 56512e816f
2 files changed
+7

No files matched your search

+5
View File
@@ -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
+2
View File
@@ -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`.