Skip to content
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!: use XDG conventions on macOS too #537

Merged
merged 1 commit into from
May 3, 2023

Conversation

utkarshgupta137
Copy link
Contributor

@utkarshgupta137 utkarshgupta137 commented May 2, 2023

~/Library/Application Support is an utterly inconvenient location for macOS users. Most CLI tools follow the XDG conventions on macOS as well. Replace the dirs crate with the etcetera crate to support it on macOS as well. Config locations for other platforms are unaffected.

Closes #534.
Closes #539.
Closes #540.
Closes #541.

@fujiapple852
Copy link
Owner

fujiapple852 commented May 3, 2023

Thank you for the PR @utkarshgupta137!

I'm a macOS user and agree that ~/Library/Application Support is not somewhere I'd typically place config files for command line tools. I'd say we can drop the macOS specific dir entirely and use only XDG for nix.

Given an alternative to the dirs crate is needed anyway due to the new licensing, and given we need something more than the home crate, I think etcetera may be a suitable alternative.

I've reworked the code slight, I've pushed a fixup commit in #539 with my suggested changes, if you're happy with them then please cherry pick to your PR and squash the commits. I've added comment to this PR explaining the changes I've made in my PR.

Thanks!

src/config.rs Outdated Show resolved Hide resolved
src/config.rs Outdated Show resolved Hide resolved
src/config.rs Outdated Show resolved Hide resolved
@utkarshgupta137 utkarshgupta137 changed the title feat: support XDG conventions on macOS too feat!: use XDG conventions on macOS too May 3, 2023
@utkarshgupta137
Copy link
Contributor Author

utkarshgupta137 commented May 3, 2023

@fujiapple852 I've included your changes & made a small modification to call choose_base_strategy only once. It calls home::home_dir, so it is better to not call it twice.
Also, feel free to update this PR if you want.

@fujiapple852
Copy link
Owner

LGTM

@utkarshgupta137
Copy link
Contributor Author

Good to merge

@fujiapple852 fujiapple852 merged commit 685d479 into fujiapple852:master May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Divest dirs crate Use XDG config dir on macOS
2 participants