hugo/testscripts/commands
Bjørn Erik Pedersen b3f10556f0
Use os.UserCacheDir as first fallback if cacheDir is not set
We will now try

1. cacheDir (or, commonly set in environment as `HUGO_CACHEDIR`)
2. if on Netlify we use `/opt/build/cache/hugo_cache/`
3. os.UserCacheDir
4. A temp dir

Storing the cache, especially the module cache, in a temporary idea has had lots of hard to debug issues, especially on MacOS,
which this commit tries to fix.

This should also make it easier to locate the Hugo cache:

>UserCacheDir returns the default root directory to use for user-specific cached data. Users should create their own
application-specific subdirectory within this one and use that.
>
>On Unix systems, it returns $XDG_CACHE_HOME as specified by
https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html if non-empty, else $HOME/.cache. On Darwin, it
returns $HOME/Library/Caches. On Windows, it returns %LocalAppData%. On Plan 9, it returns $home/lib/cache.
>
>If the location cannot be determined (for example, $HOME is not defined), then it will return an error.

Fixes #11286
Fixes #11291
2023-07-27 20:59:47 +02:00
..
commands_errors.txt
completion.txt
config.txt
config__cachedir.txt Use os.UserCacheDir as first fallback if cacheDir is not set 2023-07-27 20:59:47 +02:00
convert.txt
deploy.txt
env.txt
gen.txt
hugo.txt
hugo__configdir.txt
hugo__errors.txt
hugo__flags.txt
hugo__noconfig.txt
hugo__path-warnings-postprocess.txt
hugo__path-warnings.txt
hugo__processingstats.txt
hugo__publishdir_in_config.txt
hugo__watch.txt
hugo_configdev_env.txt
hugo_configdev_environment.txt
hugo_configprod.txt
hugo_printpathwarnings.txt
hugo_printunusedtemplates.txt
import_jekyll.txt
list.txt
mod.txt
mod__themesdir.txt
mod_npm.txt
mod_tidy.txt
mod_vendor.txt
new.txt
server.txt
server__edit_config.txt
server__edit_content.txt
server__multihost.txt
server__watch_hugo_stats.txt commands: Move testscript into its correct place 2023-07-19 19:54:36 +02:00
server_disablelivereload.txt
server_disablelivereload__config.txt
server_render_static_to_disk.txt
server_render_to_memory.txt
version.txt