fix(brew): add sbin to PATH (#13780)

This commit is contained in:
Ininsico
2026-06-01 13:55:38 +05:00
committed by GitHub
parent cfdc4822d4
commit b86a99da17
2 changed files with 16 additions and 0 deletions

View File

@@ -30,6 +30,16 @@ if [[ -z "$HOMEBREW_PREFIX" ]]; then
export HOMEBREW_PREFIX="$(brew --prefix)"
fi
# Add Homebrew sbin to PATH if it exists and is not already in PATH.
# Homebrew's shellenv only adds bin directories, not sbin. Some formulae
# (e.g. mtr) install executables to sbin, and brew doctor warns if it's
# missing from PATH.
if [[ -d "$HOMEBREW_PREFIX/sbin" ]]; then
if [[ ! "$PATH" == *"$HOMEBREW_PREFIX/sbin"* ]]; then
export PATH="$HOMEBREW_PREFIX/sbin:$PATH"
fi
fi
if [[ -d "$HOMEBREW_PREFIX/share/zsh/site-functions" ]]; then
fpath+=("$HOMEBREW_PREFIX/share/zsh/site-functions")
fi