Opravy z macos

This commit is contained in:
lachtan obecny
2026-07-13 06:06:18 +02:00
parent a2441cf23b
commit b3026487f0
5 changed files with 34 additions and 16 deletions

38
rc/brew.sh Normal file
View File

@@ -0,0 +1,38 @@
# Homebrew initialization
# Can set BREW_HOME in advance
xlog "Homebrew/Linuxbrew initialization"
BREW_LOCATIONS=(
"/opt/homebrew"
"/usr/local/Homebrew"
"$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"
prepend_path "$HOMEBREW_PREFIX/bin"
prepend_path "$HOMEBREW_PREFIX/sbin"
fi
unset BREW
unset BREW_LOCATIONS