diff options
Diffstat (limited to 'helpers/path.go')
-rw-r--r-- | helpers/path.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/helpers/path.go b/helpers/path.go index 00c541bab..4c2799ac2 100644 --- a/helpers/path.go +++ b/helpers/path.go @@ -409,7 +409,12 @@ func GetCacheDir(fs afero.Fs, cacheDir string) (string, error) { } // Fall back to a cache in /tmp. - return GetTempDir("hugo_cache", fs), nil + userName := os.Getenv("USER") + if userName != "" { + return GetTempDir("hugo_cache_"+userName, fs), nil + } else { + return GetTempDir("hugo_cache", fs), nil + } } func cacheDirDefault(cacheDir string) string { |