Skip to content

Prevent bun installer from modifying shell config#72

Merged
murrayju merged 1 commit into
mainfrom
murrayju/bun-no-shell-config
Jun 10, 2026
Merged

Prevent bun installer from modifying shell config#72
murrayju merged 1 commit into
mainfrom
murrayju/bun-no-shell-config

Conversation

@murrayju

Copy link
Copy Markdown
Member

Summary

The bun bootstrap script downloads and runs the official bun installer (https://bun.sh/install). That installer has an unwanted side-effect: it appends BUN_INSTALL and PATH exports to the user's shell config (~/.bashrc, ~/.zshrc, or config.fish).

Investigation

The installer has no dedicated flag/env var to disable shell-config modification. The behavior is gated by a case $(basename "$SHELL") switch — it only appends to a config file when the shell basename matches fish, zsh, or bash. The default *) branch merely prints manual instructions and writes nothing.

Fix

Pass SHELL="" when piping into the installer so its case falls through to the harmless default branch. Since the wrapper always invokes bun via its explicit path, the PATH exports were never needed anyway.

@murrayju murrayju requested a review from jgpruitt as a code owner June 10, 2026 14:45
@murrayju murrayju merged commit 62f4f84 into main Jun 10, 2026
3 checks passed
@murrayju murrayju deleted the murrayju/bun-no-shell-config branch June 10, 2026 15:10
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