fix(bash): add linuxbrew brew shellenv for Linux bash shells - #116
Open
github-actions[bot] wants to merge 1 commit into
Open
fix(bash): add linuxbrew brew shellenv for Linux bash shells#116github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
The linuxbrew `brew shellenv` block previously lived only in dot_profile.tmpl, guarded by `ne .chezmoi.os "darwin"`. That file is sourced by login shells, but bash login shells skip ~/.profile when ~/.bash_profile exists (per `man bash` FILES), so on Linux machines where the passwd entry wasn't re-pointed, the linuxbrew PATH addition was lost. Source the same block from dot_bashrc.tmpl instead, which is sourced by both login bash (via .bash_profile) and non-login bash. The directory existence check (-d /home/linuxbrew/.linuxbrew) makes it a no-op on macOS, so no chezmoi OS template gate is needed here. Keeps the rest of .profile (atuin env, LM Studio native path) out of bash startup, which is the targeted fix from the parent #55 proposal. Closes #73
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Automated fix attempt
This PR was generated by the
droid-issue-fixerGitHub Action, which runsdroid execheadlessly to attempt an open issue.Closes #73
Droid exec summary
Summary
Implemented issue #73:
fix(bash): add linuxbrew brew shellenv for Linux bash shells.What changed. Added a 4-line linuxbrew block (plus 6-line comment) to
dot_bashrc.tmpl, inserted right after the existing PATH setup. The block evaluates/home/linuxbrew/.linuxbrew/bin/brew shellenvwhenever that directory is present, so it activates on Linux machines that use linuxbrew and is a no-op anywhere else (including macOS, where/home/linuxbrew/.linuxbrewdoesn't exist).Why. The same block already lived in
dot_profile.tmpl, but bash login shells skip~/.profilewhen~/.bash_profileexists (perman bashFILES), so on any Linux host where the passwd entry stayed bash — which is the default everywhere except macOS-laptops wherechsh/usermod wasn't run — the linuxbrew PATH addition never ran. Sourcing fromdot_bashrc.tmplinstead covers both login bash (via.bash_profile) and non-login bash with the targeted change, without dragging the rest of~/.profile(atuin env, LM Studio native path) into bash startup — matching the "option 2 / targeted fix the proposal called out from the broader parent #55 linuxbrew gap**.Validation. Rendered the affected template with
chezmoi execute-template --config "$CHEZMOI_CI_CONFIG"and ranbash -non the rendered output — both clean. Re-rendered the neighboringdot_bash_profile.tmplanddot_profile.tmpltemplates and ranbash -non those too — both clean. Ranshellcheckon the rendereddot_bashrc.tmpl; every warning was pre-existing on lines I did not touch (SC2148, SC1091, SC1090, SC2076), and my new block introduces zero new diagnostics.Commit. One commit on
droid/issue-73-bash-linuxbrew:The branch is local and clean. The workflow takes it from here.
Untouched issues. Skipped #105 (large repo-wide rename into
home/), #87 (needs zsh validation; this runner lacks zsh), #70 (zsh validation), #8 (macOS-only AppleScript), #25/#66 (Windows/containers), #94 (tracking only), #93 (cosmetic plugin toggle), and the others whose scope exceeded a single targeted edit.