summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--zsh/.zprofile16
-rw-r--r--zsh/.zshrc3
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