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

Use XDG conventions on macOS too #833

Merged
merged 1 commit into from
Apr 24, 2023

Conversation

utkarshgupta137
Copy link
Contributor

@utkarshgupta137 utkarshgupta137 commented Apr 22, 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 directories-next crate with the etcetera crate to use it on macOS. Config locations for other platforms are unchanged.

@welcome
Copy link

welcome bot commented Apr 22, 2023

Thanks for opening this pull request!

@denisidoro
Copy link
Owner

Isn't this a breaking change? What will happen to existing OSX users?

@utkarshgupta137
Copy link
Contributor Author

Isn't this a breaking change? What will happen to existing OSX users?

Right now this PR makes no effort to maintain backward compatibility on macOS. IMO, no macOS users expect the config file to be located in ~/Library/Application Support. Almost every CLI tool which uses the dirs/dirs-next crates & other clones has open or closed issues of users wanting to use the XDG conventions on macOS. But I've yet to come across a case where the inverse is true. I've written more about this here.
However, since you probably want to maintain backward compatibility, I can add migration code to move the old data to the new location, similar to this: https://github.com/cantino/mcfly/pull/349/files#diff-4f91d834bba4a3a432715f3ccf4ebc7c10d7ecfb974f1e78f56108dd80581a53R392-R403

@denisidoro
Copy link
Owner

However, since you probably want to maintain backward compatibility, I can add migration code to move the old data to the new location

That would be awesome!

Perhaps a simpler approach could be the following?

  1. if on osx, try to use ~/Library/.../navi/... if it exists
  2. otherwise, use whatever etcetera determines

@utkarshgupta137
Copy link
Contributor Author

However, since you probably want to maintain backward compatibility, I can add migration code to move the old data to the new location

That would be awesome!

Perhaps a simpler approach could be the following?

1. if on osx, try to use ~/Library/.../navi/... if it exists

2. otherwise, use whatever etcetera determines

Done.

@denisidoro denisidoro merged commit 6f316ec into denisidoro:master Apr 24, 2023
@welcome
Copy link

welcome bot commented Apr 24, 2023

Congrats on merging your first pull request!

@utkarshgupta137
Copy link
Contributor Author

@denisidoro Waiting for a release :)

shinzui added a commit to shinzui/home-manager that referenced this pull request Dec 26, 2023
Navi no longer store the config in `Libary/Application Support` on mac.

denisidoro/navi#833
shinzui added a commit to shinzui/home-manager that referenced this pull request Dec 27, 2023
Navi no longer stores the config in `Libary/Application Support` on mac.

denisidoro/navi#833
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.

2 participants