Skip to content

fix(bash): add linuxbrew brew shellenv for Linux bash shells - #116

Open
github-actions[bot] wants to merge 1 commit into
mainfrom
droid/issue-73-bash-linuxbrew
Open

fix(bash): add linuxbrew brew shellenv for Linux bash shells#116
github-actions[bot] wants to merge 1 commit into
mainfrom
droid/issue-73-bash-linuxbrew

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Automated fix attempt

This PR was generated by the droid-issue-fixer GitHub Action, which runs
droid exec headlessly 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 shellenv whenever 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/.linuxbrew doesn't exist).

Why. The same block already lived in dot_profile.tmpl, but bash login shells skip ~/.profile when ~/.bash_profile exists (per man bash FILES), so on any Linux host where the passwd entry stayed bash — which is the default everywhere except macOS-laptops where chsh/usermod wasn't run — the linuxbrew PATH addition never ran. Sourcing from dot_bashrc.tmpl instead 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 ran bash -n on the rendered output — both clean. Re-rendered the neighboring dot_bash_profile.tmpl and dot_profile.tmpl templates and ran bash -n on those too — both clean. Ran shellcheck on the rendered dot_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:

fix(bash): add linuxbrew brew shellenv for Linux bash shells

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

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.

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
@github-actions github-actions Bot added the droid PR generated by droid-issue-fixer action label Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

droid PR generated by droid-issue-fixer action

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(bash): add linuxbrew brew shellenv to dot_bashrc.tmpl for Linux login shells

1 participant