From c3e1b1896ab156f6fa1529ebd630b065eff42efa Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Fri, 13 Feb 2026 13:52:43 -0600 Subject: fix homebrew path and profile --- zsh/.zprofile | 16 +++++++++++++++- zsh/.zshrc | 3 +-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/zsh/.zprofile b/zsh/.zprofile index 37e194a..67eda70 100644 --- a/zsh/.zprofile +++ b/zsh/.zprofile @@ -1,2 +1,16 @@ +# ============================================================================== +# HOMEBREW INITIALIZATION (macOS & Linux) +# ============================================================================== -eval "$(/opt/homebrew/bin/brew shellenv)" +if [[ "$(uname)" == "Darwin" ]]; then + # macOS (Apple Silicon) + BREW_PATH="/opt/homebrew/bin/brew" +elif [[ "$(uname)" == "Linux" ]]; then + # Linux (Linuxbrew) + BREW_PATH="/home/linuxbrew/.linuxbrew/bin/brew" +fi + +# Only run shellenv if the brew binary actually exists at that path +if [[ -f "$BREW_PATH" ]]; then + eval "$($BREW_PATH shellenv)" +fi diff --git a/zsh/.zshrc b/zsh/.zshrc index f8a84ec..aab6477 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -23,9 +23,8 @@ fi # 3. ENVIRONMENT VARIABLES & PATH # ============================================================================== -export PATH="/home/linuxbrew/.linuxbrew/bin:$PATH" export PATH="$HOME/.local/xonsh-env/xbin:$PATH" -export PATH="$BREW_PREFIX:$PATH" +export PATH="$BREW_PREFIX/bin:$PATH" export GPG_TTY=$(tty) # borgbackup -- cgit v1.2.3