install
install copied to clipboard
install instructions fail when shell profile does not end with a newline
Please note we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again.
- [x] your problem was from running the official
install
oruninstall
script? - [x] after installation: ran
brew config
andbrew doctor
and included their output with your issue? If you couldn't install: provided your OS version with the output of your issue?
this was on a m1 mac running macos 12.5
What you were trying to do (and why)
I installed homebrew with the install script from brew.sh, after i had installed another program that left a line without a newline as last line.
What happened (include command output)
the install script told me to execute 2 commands: https://github.com/Homebrew/install/blob/master/install.sh#L1013
echo 'eval "\$(${HOMEBREW_PREFIX}/bin/brew shellenv)"' >> ${shell_profile}
eval "\$(${HOMEBREW_PREFIX}/bin/brew shellenv)"
the first of these lines expects that the profile script already ends with a new line, and while I agree that it always should end with a newline in some cases it does not. In my case jetbrains toolbox added a PATH=.... command to the profile script, so after executing the install commands I had a script that does not run:
export PATH="....."eval /opt/hombebrew/bin/...
I'm not sure what the best fix would, maybe the missing newline could be detected and then the install instructions could add contain a newline.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.