yeoman / configstore

Easily load and persist config without having to think about where and how
BSD 2-Clause "Simplified" License
868 stars 56 forks source link

Allow user to override location of `configstore` directory using an environment variable #74

Open MatejKafka opened 3 years ago

MatejKafka commented 3 years ago

Some users may have different opinion on where configstore should store the data. For example, using C:\Users\<name>\.config on Windows is unconventional and not really common or recommended (dotfiles only tend to be used by software ported from Linux, Windows-native software always uses AppData).

Configstore should support an environment variable like CONFIGSTORE_DIR and store the config elsewhere if it is set.

fregante commented 4 months ago

Isn't this what XDG_CONFIG_HOME does?

XDG_CONFIG_HOME=/other/path your-cli-tool

Also the package has a path option already:

https://github.com/yeoman/configstore?tab=readme-ov-file#configpath

I think this issue can be closed.

MatejKafka commented 2 months ago

It's a bit weird that XDG_CONFIG_HOME is followed on Windows, given that it's a Linux-only concept. Also, it appends configstore after XDG_CONFIG_HOME, you cannot use it to specify the exact directory that should be used.

Also the package has a path option already:

That's only useful for the application (and discouraged in the linked docs), not for the end user.