Files
linux-workspace/rc.local/linuxbrew.sh
2022-09-30 18:46:24 +02:00

30 lines
548 B
Bash

# Homebrew initialization
# Can set BREW_HOME in advance
BREW_LOCATIONS=( \
"$HOME/.local/share/linuxbrew" \
"$HOME/.linuxbrew" \
"/home/linuxbrew/.linuxbrew" \
)
if [[ ! -d "$BREW_HOME" ]]; then
for brew_path in "${BREW_LOCATIONS[@]}"; do
if [[ -d "$brew_path" ]]; then
BREW_HOME="$brew_path"
break
fi
done
fi
BREW="$BREW_HOME/bin/brew"
if [[ -e "$BREW" ]]; then
path_backup="$PATH"
eval "$($BREW shellenv)"
PATH="$path_backup"
append_path "$HOMEBREW_PREFIX/bin"
append_path "$HOMEBREW_PREFIX/sbin"
fi