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 the existing bash init file in Darwin to avoid accidentally overriding existing config #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

theRobinator
Copy link

Bash startup is weird and will only read from a single config file when an interactive login shell is started. From the bash man page:

When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable.

The old behavior of the install script was to always write to ~/.bash_profile. If a user stored their configuration in .bash_login or .profile, the newly-created .bash_profile would take precedence over the existing file, causing all existing login config to be ignored.

This PR updates the install script to append our init snippet to whatever file the user is already using, only creating a new .bash_profile if no files already exist.

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.

1 participant