Join rc and rc.local folders
This commit is contained in:
36
rc/linuxbrew.sh
Normal file
36
rc/linuxbrew.sh
Normal file
@@ -0,0 +1,36 @@
|
||||
# Homebrew initialization
|
||||
# Can set BREW_HOME in advance
|
||||
|
||||
xlog "Homebrew initialization"
|
||||
|
||||
BREW_LOCATIONS=(
|
||||
"$HOME/.local/share/linuxbrew"
|
||||
"$HOME/.linuxbrew"
|
||||
"/home/linuxbrew/.linuxbrew"
|
||||
)
|
||||
|
||||
if [[ -z "$BREW_HOME" ]]; then
|
||||
for brew_path in "${BREW_LOCATIONS[@]}"; do
|
||||
xlog "CHECK $brew_path"
|
||||
if [[ -d "$brew_path" ]]; then
|
||||
BREW_HOME="$brew_path"
|
||||
xlog "FOUND $BREW_HOME"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
BREW="$BREW_HOME/bin/brew"
|
||||
|
||||
if [[ -e "$BREW" ]]; then
|
||||
xlog "Loading brew shell environment from $BREW_HOME"
|
||||
path_backup="$PATH"
|
||||
eval "$($BREW shellenv)"
|
||||
PATH="$path_backup"
|
||||
|
||||
append_path "$HOMEBREW_PREFIX/bin"
|
||||
append_path "$HOMEBREW_PREFIX/sbin"
|
||||
fi
|
||||
|
||||
unset BREW
|
||||
unset BREW_LOCATIONS
|
||||
Reference in New Issue
Block a user