Skip to content

Loading…

Follow the XDG base directory specification #1076

Closed
arcresu opened this Issue · 7 comments

3 participants

@arcresu

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).

@passy
Yeoman member

I didn't know we were still using ~/.yeoman for something.

@sindresorhus Do you know where/how this is used?

@sindresorhus
Yeoman member

I absolutely agree.

Looks like we're using it in:

lib/actions/actions.js
260:  var cache = path.join(home, '.yeoman/cache', username, repo, branch);
@passy
Yeoman member

Do we need that persistent cache at all? Wouldn't it be sufficient to use a tmpdir and remove it once we're done?

@sindresorhus
Yeoman member

Yeah, we don't want users having to wait for the generator to fetch the remote thing every time the generator is used.

@passy
Yeoman member

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.

@sindresorhus
Yeoman member

@passy agreed.

@sindresorhus
Yeoman member

This was fixed at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.