Commit 81137fa2d7
Verified · cmc
Layout: unified · split
common/zsh/.zshrc +16 −3
| @@ -2,15 +2,28 @@ | |||
| 2 | # 1. OS-SPECIFIC CONFIGURATION | 2 | # 1. OS-SPECIFIC CONFIGURATION |
| 3 | # ============================================================================== | 3 | # ============================================================================== |
| 4 | 4 | ||
| 5 | # Use uname to detect the OS and set the correct Homebrew path | ||
| 6 | if [[ "$(uname)" == "Darwin" ]]; then | 5 | if [[ "$(uname)" == "Darwin" ]]; then |
| 7 | # macOS (Apple Silicon) | 6 | # macOS - Check for custom path first, then standard paths |
| 8 | BREW_PREFIX="/opt/homebrew" | 7 | if [ -d "$HOME/Documents/.brew" ]; then |
| 8 | # Custom installation path | ||
| 9 | BREW_PREFIX="$HOME/Documents/.brew" | ||
| 10 | elif [ -d "/opt/homebrew" ]; then | ||
| 11 | # Standard path for Apple Silicon Macs | ||
| 12 | BREW_PREFIX="/opt/homebrew" | ||
| 13 | else | ||
| 14 | # Standard path for Intel Macs | ||
| 15 | BREW_PREFIX="/usr/local" | ||
| 16 | fi | ||
| 9 | elif [[ "$(uname)" == "Linux" ]]; then | 17 | elif [[ "$(uname)" == "Linux" ]]; then |
| 10 | # Linux (Linuxbrew) | 18 | # Linux (Linuxbrew) |
| 11 | BREW_PREFIX="/home/linuxbrew/.linuxbrew" | 19 | BREW_PREFIX="/home/linuxbrew/.linuxbrew" |
| 12 | fi | 20 | fi |
| 13 | 21 | ||
| 22 | # If a Homebrew installation was found, add it to the shell environment | ||
| 23 | if [ -n "$BREW_PREFIX" ]; then | ||
| 24 | eval "$($BREW_PREFIX/bin/brew shellenv)" | ||
| 25 | fi | ||
| 26 | |||
| 14 | # ============================================================================== | 27 | # ============================================================================== |
| 15 | # 2. PRE-INITIALIZATION (Instant Prompt) | 28 | # 2. PRE-INITIALIZATION (Instant Prompt) |
| 16 | # ============================================================================== | 29 | # ============================================================================== |