Auto-fix .bashrc sourcing during install.sh on macOS/BSD/Solaris #2343
+82
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Automatically sets up .bashrc sourcing during bash-it installation on macOS, BSD, Solaris, and Illumos systems.
This PR builds on the detection capability added in #2342 by implementing the auto-fix during installation.
Problem
On macOS/BSD/Solaris, login shells source
.bash_profileor.profile, NOT.bashrc.Without this fix, users would:
./install.shsuccessfullyMany users wouldn't know why or how to fix it.
Solution
During installation, automatically detect and fix .bashrc sourcing:
1. Platform Detection
2. Smart Detection
_bash-it-doctor-check-profile-sourcing-grep()from Detect .bashrc sourcing issues on macOS/BSD/Solaris in doctor #23423. Interactive Prompt
-sflag): auto-accepts (safe default)4. Safe Modifications
command cpto bypass user aliases (defensive programming).bash_profileif no profile file existsUser Experience
Before (macOS user):
After (macOS user):
Silent mode:
$ ./install.sh -s ... ✓ Added .bashrc sourcing to /Users/me/.bash_profile Installation finished successfully!Code Snippet Added
The installer adds this standard snippet to the profile file:
Implementation Details
command cpto bypass aliasesTesting
Closes
Closes #1455 (Solaris/Illumos support)
Related
🤖 Generated with Claude Code
Co-Authored-By: Claude [email protected]