-
Notifications
You must be signed in to change notification settings - Fork 78
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
feat: follow XDG Base Directory Specification #105
base: master
Are you sure you want to change the base?
Conversation
fixes #81 |
1b389b1
to
8d77c23
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello!
Thank you for your contribution! :)
After discussing with the team, we think it's best to use these two functions that are included in golang's os
built-in library:
More specifically, UserCacheDir
should be used to store the relationships cache and UserHomeDir
should be used to store the user's configuration.
Cheers,
Marta
I think you meant I will apply the suggested changes. |
Done via 6c02129 |
Hello @mochaaP, Thank you for such a quick response! About your comment: I meant the home dir specifically. Right now vt-cli's configuration file is stored in the home directory. Storing it somewhere else is a breaking change that will force everyone to reconfigure their vt-cli again. In addition to that, making manual changes to the file stored in the config dir is harder since remembering the path is harder than simply accessing your home directory. If I run Cheers, |
I will make viper try to find |
made it migrate the configuration file automatically so existing installations won't break. imo this is better because:
|
What about something like this?
This way windows users can benefit from this while UNIX users keep the behaviour they are used to. |
I think unix users today prefer the use of ~/.config and following this convention has been popularized among many programs. |
The concern is not really with Linux, but with macOS, putting the config file in Regarding whether to put the config file in I like the idea of getting rid of |
I beg to differ (from a Linux user perspective). I think applications that don't use use the XDG specs are developed by devs who don't know that such a thing exists. There are multiple reasons to use it, some of which are explained here https://xdgbasedirectoryspecification.com |
Indeed, I take responsibility for not adhering to the XDG specifications when this tool was implemented. At the time, I was unaware of the XDG standards, and it was only after this issue was raised that I became familiar with them. That said, I do recognize the advantages of following these specifications. I fully support incorporating the XDG_ environment variables and even agree with relocating the configuration file to ~/.config. However, what I strongly oppose is having the configuration file stored in different locations on Linux and macOS. As I mentioned earlier, $HOME/Library/Application Support is likely the most appropriate location for configuration files in native macOS applications. But for a cross-platform CLI application, I believe it’s better to maintain consistency by storing the configuration file in the same path on both Linux and macOS. |
See https://specifications.freedesktop.org/basedir-spec/latest/.