known-folders
known-folders copied to clipboard
Detect the XDG runtime setting in env instead of configuration (on macOS)
For some compatibility reasons, I set my own XDG Base Directories. Not equal to default macOS folder suggestions.
I know there is a configuration to open XDG support on Mac, but some zig tools (such as zls ) don't provide a method to change it. If known-folders can read env and follow the XDG settings, will resolve this problem.
Make an issue on their repository to enable XDG on mac. They only have to add this to their root file:
pub const known_folders_config = .{ .xdg_on_mac = true };
Indeed this is a method. But I think it's still necessary to detect env:
- Give the choice to the end-user, not binary developers. Since one binary will be used by many users with different enviroments.
- By detecting env variables, a user can opt-in XDG directory, and use other directories in macOS default.