diff options
| -rw-r--r-- | common/zsh/.zshrc | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/common/zsh/.zshrc b/common/zsh/.zshrc index 07452f2..21304c8 100644 --- a/common/zsh/.zshrc +++ b/common/zsh/.zshrc @@ -2,15 +2,28 @@ # 1. OS-SPECIFIC CONFIGURATION # ============================================================================== -# Use uname to detect the OS and set the correct Homebrew path if [[ "$(uname)" == "Darwin" ]]; then - # macOS (Apple Silicon) - BREW_PREFIX="/opt/homebrew" + # macOS - Check for custom path first, then standard paths + if [ -d "$HOME/Documents/.brew" ]; then + # Custom installation path + BREW_PREFIX="$HOME/Documents/.brew" + elif [ -d "/opt/homebrew" ]; then + # Standard path for Apple Silicon Macs + BREW_PREFIX="/opt/homebrew" + else + # Standard path for Intel Macs + BREW_PREFIX="/usr/local" + fi elif [[ "$(uname)" == "Linux" ]]; then # Linux (Linuxbrew) BREW_PREFIX="/home/linuxbrew/.linuxbrew" fi +# If a Homebrew installation was found, add it to the shell environment +if [ -n "$BREW_PREFIX" ]; then + eval "$($BREW_PREFIX/bin/brew shellenv)" +fi + # ============================================================================== # 2. PRE-INITIALIZATION (Instant Prompt) # ============================================================================== |
