Instead of polluting the home directory with ~/.yeoman, follow the XDG Base Directory Specification.
In particular, $XDG_CACHE_HOME/yeoman/ (defaults to $HOME/.cache/yeoman/) should be used instead of $HOME/.yeoman/cache/. As well as keeping the home directory clean, the semantic separation of config, runtime data, cache data and user-local software by the spec is helpful to users and other tools (e.g. backup software).
I didn't know we were still using ~/.yeoman for something.
@sindresorhus Do you know where/how this is used?
I absolutely agree.
Looks like we're using it in:
260: var cache = path.join(home, '.yeoman/cache', username, repo, branch);
Do we need that persistent cache at all? Wouldn't it be sufficient to use a tmpdir and remove it once we're done?
Yeah, we don't want users having to wait for the generator to fetch the remote thing every time the generator is used.
Hm, alright. I think it could make sense to have some reusable caching mechanism, that uses the correct paths. Something like this.cacheDir('fetch', username, repo, branch) that resolves to $XDG_CACHE_HOME/yeoman/fetch/... and creates the directories along the way.
this.cacheDir('fetch', username, repo, branch)
This was fixed at some point.