oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
71.09k stars 2.47k forks source link

bun still re-adds itself to .zshrc every update #10897

Open mrdomino opened 1 week ago

mrdomino commented 1 week ago

What version of Bun is running?

1.1.7+b0b7db5c0

What platform is your computer?

Darwin 23.4.0 arm64 arm

What steps can reproduce the bug?

  1. have a zshrc in which your bun completions are added to fpath in some other manner than the one the stock installer provides.
  2. have an out of date bun.
  3. run bun upgrade.

What is the expected behavior?

bun should notice that the completions are already present in the shell and do nothing.

What do you see instead?

re-inserts the same two lines into the end of .zshrc every single time.

Additional information

This is the same bug as #7641. That was apparently supposed to be fixed, but the fix was dependent on having a comment line in .zshrc. I put that comment in my .zshrc, and bun kept on adding those two lines anyway, so the fix is not working.

I still think it would probably be better to simply check whether the zsh interactive environment appears to have bun configured or not.