directories-rs
directories-rs copied to clipboard
Support global config directory in ProjectDirs
Hi! It would be great if this library supported global config directories... My idea is:
| Platform | Value | Example |
|---|---|---|
| Linux | /etc/_project_path_ |
/etc/barapp |
| macOS | /etc/_project_path_ or /usr/local/etc/_project_path_ (if installed via homebrew) |
/etc/barapp |
| Windows | %ProgramData%\_project_path_\config |
C:\ProgramData\Bar App\config |
MacOS implementation challenges:
- Only the "bundle_id" is passed to
project_dirs_from_path, which makes it hard to get the_project_path_. - How to detect if running through homebrew? Does homebrew patch repositories to change
/etc/to/usr/local/etc?
Another idea would be to use /Library/Application Support instead...
Kind of related to https://github.com/dirs-dev/directories-rs/issues/78
One thing to add here is that the actual xdg spec uses XDG_CONFIG_DIRS which is /etc/xdg by default.
These are all related: #87 #78 #58