From 81137fa2d7a0710713d2afed1f2d1955cfd6cefa Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Mon, 23 Feb 2026 11:56:48 -0600 Subject: add option for local brew --- common/zsh/.zshrc | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'common') 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) # ============================================================================== -- cgit v1.2.3