feat: use XDG directories on Linux
This removes the need for the ~/.dart_tool directory in user's HOME. It moves the config file to $XDG_CONFIG_HOME/dart_tool, and all other data to $XDG_DATA_HOME/dart_tool. If the old directory exists but the new one doesn't, the old location is used as a fallback. Otherwise, the new directories are created.
See https://github.com/dart-lang/sdk/issues/41560 (this doesn't fully solve the issue, but it does get rid of one of the offending directories)
- [x] I’ve reviewed the contributor guide and applied the relevant portions to this PR.
Contribution guidelines:
- See our contributor guide for general expectations for PRs.
- Larger or significant changes should be discussed in an issue before creating a PR.
- Contributions to our repos should follow the Dart style guide and use
dart format. - Most changes should add an entry to the changelog and may need to rev the pubspec package version.
- Changes to packages require corresponding tests.
Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.
thanks for this PR! I was thinking that we could add some utilities for this to the cli_util package and then use them across any dart programs. What do you think? See dart-archive/cli_util#94
can you make sure this also applies to macos?
@jonasfj Would this be merged?
does this need anything to work? (to be merged)
/cc @srawlins @bkonyi
CC @bwilkerson . I'm not sure who maintains unified_analytics these days.
CC @bwilkerson . I'm not sure who maintains unified_analytics these days.
The Dash Developer Services team does, although there hasn't really been any active work in this area for awhile.
We're actively deciding where we want all of the Dart / Flutter tools to write state in https://github.com/dart-lang/sdk/issues/41560, but I don't think we're going to move forward with this PR at this time (please see the discussion in the linked issue).