Skip to content

Commit

Permalink
Respect non-default brew installation locations
Browse files Browse the repository at this point in the history
  • Loading branch information
jfsiii authored and mathiasbynens committed Sep 28, 2018
1 parent b07314e commit bb6c76e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions brew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ brew update
# Upgrade any already-installed formulae.
brew upgrade

# Save Homebrew’s installed location.
BREW_PREFIX=$(brew --prefix)

# Install GNU core utilities (those that come with macOS are outdated).
# Don’t forget to add `$(brew --prefix coreutils)/libexec/gnubin` to `$PATH`.
brew install coreutils
ln -s "${BREW_PREFIX}/bin/gsha256sum" "${BREW_PREFIX}/bin/sha256sum"

# Install some other useful utilities like `sponge`.
brew install moreutils
Expand All @@ -19,15 +23,13 @@ brew install findutils
# Install GNU `sed`, overwriting the built-in `sed`.
brew install gnu-sed --with-default-names
# Install Bash 4.
# Note: don’t forget to add `/usr/local/bin/bash` to `/etc/shells` before
# running `chsh`.
brew install bash
brew install bash-completion2

# Switch to using brew-installed bash as default shell
if ! fgrep -q '/usr/local/bin/bash' /etc/shells; then
echo '/usr/local/bin/bash' | sudo tee -a /etc/shells;
chsh -s /usr/local/bin/bash;
if ! fgrep -q "${BREW_PREFIX}/bin/bash" /etc/shells; then
echo "${BREW_PREFIX}/bin/bash" | sudo tee -a /etc/shells;
chsh -s "${BREW_PREFIX}/bin/bash";
fi;

# Install `wget` with IRI support.
Expand Down

0 comments on commit bb6c76e

Please sign in to comment.