Created
July 31, 2016 13:10
-
-
Save lojikil/0bb81da8713432f19f3f55e6fbef6797 to your computer and use it in GitHub Desktop.
backup copy of a single-user `brew` installation
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
# change to whatever location to where homebrew is installed | |
if [ -z "$HOMEBREW_HOME" ]; then | |
export HOMEBREW_HOME=$HOME/homebrew | |
echo "HOMEBREW_HOME=$HOME/homebrew" >> ~/.profile | |
fi | |
# install homebrew for single user | |
if [ ! -d "$HOMEBREW_HOME" ]; then | |
mkdir -p $HOMEBREW_HOME && curl -L https://github.com/Homebrew/homebrew/tarball/master | tar xz --strip 1 -C $HOMEBREW_HOME | |
fi | |
# add the new homebrew bin directory to the path | |
if [ -z `echo $PATH | grep "$HOMEBREW_HOME"` ]; then | |
echo "PATH=$HOMEBREW_HOME/bin:$PATH" >> ~/.profile | |
export PATH=$HOMEBREW_HOME/bin:$PATH | |
fi | |
# configure the local homebrew cache directory | |
if [ -z "$HOMEBREW_CACHE" ]; then | |
echo "HOMEBREW_CACHE=$HOME/Library/Caches/Homebrew" >> ~/.profile | |
export HOMEBREW_CACHE=$HOME/Library/Caches/Homebrew | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you see the following:
you can safely delete ~/homebrew/share/doc/homebrew; I dunno when this happened, but it only happens with new installs (and thus I've not had a chance to test it, as I only end up with a new mac every few years. I probably should figure out where in the install process I can delete that, but for now, it's safe to delete that path if you see it.