This script installs Homebrew in your $HOME.
It will also move all temporary Homebrew data (Temp, Cache, Locks) to a dedicated folder in /tmp, leaving your home directory cleaner.
Run this command from your terminal:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/wethinkcode/homebrew/master/install.sh)"
This script removes your current Homebrew installation in your home, and reinstalls it properly from the Homebrew Github repo.
Then it simply creates a .brew_fix.zsh script in your home directory, and modifies your .zshrc to source the script.
It is simple to remove, and you can re-run it multiple times without duplication.
Simply remove these lines from your .zshrc
# Load Homebrew Fix script
source $HOME/.brew_fix.zsh
And delete .brew_fix.zsh in your home directory.