cache: Set default cache path based on $USER

Change the default cache directory to `$TMPDIR/hugo_cache_$USER`, so
that multi-user systems do not have caches that interfere with each
other.  The other cache-choosing logic (e.g. Netlify exceptions,
configuration options) are not affected.

Fixes #7391
This commit is contained in:
Erica Mays
2023-06-10 13:25:07 -04:00
committed by Bjørn Erik Pedersen
parent 254c2b323c
commit 258884f44f
16 changed files with 21 additions and 16 deletions

View File

@@ -33,7 +33,7 @@ hugo server [command] [flags]
-D, --buildDrafts include content marked as draft
-E, --buildExpired include expired content
-F, --buildFuture include content with publishdate in the future
--cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/
--cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache_$USER/
--cleanDestinationDir remove files from destination not found in static directories
-c, --contentDir string filesystem path to content directory
--disableBrowserError do not show build errors in the browser