Created
September 6, 2017 15:12
-
-
Save chriswgerber/c3e237840a3789b2db2057fdf799185e to your computer and use it in GitHub Desktop.
Single-User Homebrew Install
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export HOMEBREW_INSTALL_BADGE="🦍" | |
export HOMEBREW_PREFIX="$HOME" | |
export HOMEBREW_REPOSITORY="$HOME/Library/Homebrew" | |
test -d $HOMEBREW_REPOSITORY || git clone [email protected]:Homebrew/brew.git $HOMEBREW_REPOSITORY | |
# install homebrew for single user | |
# add the new homebrew bin directory to the path | |
if [ -z `echo $PATH | grep "$HOMEBREW_REPOSITORY"` ]; then | |
if [[ "$SHELL" == *"bash"* ]]; then | |
echo "PATH=$HOMEBREW_REPOSITORY/bin:$PATH" >> ~/.zshrc | |
else | |
echo "PATH=$HOMEBREW_REPOSITORY/bin:$PATH" >> ~/.profile | |
fi | |
export PATH=$HOMEBREW_HOME/bin:$PATH | |
fi | |
# configure the local homebrew cache directory | |
if [ -z "$HOMEBREW_CACHE" ]; then | |
if [[ "$SHELL" == *"bash"* ]]; then | |
echo "HOMEBREW_CACHE=$HOME/Library/Caches/Homebrew" >> ~/.zshrc | |
else | |
echo "HOMEBREW_CACHE=$HOME/Library/Caches/Homebrew" >> ~/.profile | |
fi | |
fi | |
export HOMEBREW_CACHE=$HOME/Library/Caches/Homebrew | |
# Cask | |
export HOMEBREW_CASK_OPTS="--appdir=${HOME}/Applications" | |
# Completions | |
fpath=($HOMEBREW_REPOSITORY/share/zsh/site-functions $fpath) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment