Join rc and rc.local folders

This commit is contained in:
lachtan
2025-01-03 16:58:29 +00:00
parent 87cc0c95ac
commit 6854c3bfa8
12 changed files with 1 additions and 5 deletions

36
rc/linuxbrew.sh Normal file
View 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