-
Notifications
You must be signed in to change notification settings - Fork 892
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
Edit .bash_profile if it exists #1090
Conversation
Hi @awelkie, this looks great. I would like to slightly alter the detection logic here, specifically:
IMO, this would provide the best result given each shell's profile logic. However, I'd be happy to accept this PR as-is if you won't be able to make these changes, since it's a clear improvement over the status quo, and shouldn't cause any problems to tweak later. |
I'll take a crack at making these changes. I would also like to add support for fish (#478). Should the logic there be to add add a file to ~/.config/fish/conf.d only if ~/.config/fish/ exists, regardless of the current shell? |
@awelkie Thanks! For all shells except bash, we should set their configuration if we detect their presence at all on the system. For the moment, the two detection methods we use are Bash is different, because it will fall back to So for fish, we want to add a file to |
I don't think I'll be able to get to the making the improvements for another few days, so feel free to merge this in if you want. |
For this PR I agree that at least it would be better to remove reading "SHELL" and just look for the presense of .bash_profile. zsh changes can be left for some other PR. This should really also have a test case. Crib off of "install_adds_path_to_profile". |
I've updated this in #1179. |
Fixes #883