Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate nvm dir from XDG_CONFIG_HOME to XDG_DATA_HOME #108

Closed
thernstig opened this issue May 26, 2020 · 7 comments
Closed

Migrate nvm dir from XDG_CONFIG_HOME to XDG_DATA_HOME #108

thernstig opened this issue May 26, 2020 · 7 comments
Milestone

Comments

@thernstig
Copy link

To show case what I mean, I am going to paste the information another tool called direnv does in a recent release:

Migrating the allow data to the new location

The allowed .envrc permissions used to be stored in the XDG_CONFIG_HOME. It's
better to keep that folder for user-editable configuration so the data is
being moved to XDG_DATA_HOME.

moving /home/userA/.config/direnv/allow to /home/userA/.local/share/direnv/allow
creating a symlink back from /home/userA/.local/share/direnv/allow to /home/userA/.config/direnv/allow for back-compat.

All done, have a nice day!

As such, it would make sense for nvm to also migrate from XDG_CONFIG_HOME to XDG_DATA_HOME. The config is used for user-editable config whereas the data dir should be used for data written by the program such as nvm.

One of many reasons to do this is that a lot of users utilize dotfile support to backup configuration data, and that is often done for the XDG_CONFIG_HOME dir. Since nvm downloads binaries, it would mean many users might commit binaries to their git repo if they do not take care. Users do not expect the config dir to contain binaries.

@jorgebucaran
Copy link
Owner

@thernstig A breaking change, yes, but implementation-wise, just saving to a different directory, right?

@thernstig
Copy link
Author

Yes, that should be all there is to it.

@jorgebucaran
Copy link
Owner

@thernstig Sounds good to me.

@jorgebucaran
Copy link
Owner

@thernstig Feel free to send me a PR.

@thernstig
Copy link
Author

Any chance it could stay open till I do? :)

@jorgebucaran
Copy link
Owner

@thernstig I think this got closed when I migrated to the main branch, otherwise I don't know why I closed this. I'll make sure to use XDG_DATA_HOME in 2.0.

@jorgebucaran jorgebucaran reopened this Nov 14, 2020
@jorgebucaran jorgebucaran added this to the 2.0 milestone Nov 14, 2020
@jorgebucaran jorgebucaran mentioned this issue Nov 14, 2020
@jorgebucaran
Copy link
Owner

I just released 2.0. Now we're using XDG_DATA_HOME to store nvm's state: version binaries, and the download index file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants