summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-02-23 11:56:48 -0600
committerChristian Cleberg <[email protected]>2026-02-23 11:56:48 -0600
commit81137fa2d7a0710713d2afed1f2d1955cfd6cefa (patch)
tree2e6bc136e813813b7699f15d9dd917ee4648f21c
parent885980a3b3ecd5c739713388fc25baa86dc11a6d (diff)
downloaddotfiles-81137fa2d7a0710713d2afed1f2d1955cfd6cefa.tar.gz
dotfiles-81137fa2d7a0710713d2afed1f2d1955cfd6cefa.tar.bz2
dotfiles-81137fa2d7a0710713d2afed1f2d1955cfd6cefa.zip
add option for local brew
-rw-r--r--common/zsh/.zshrc19
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)
# ==============================================================================