summary refs log tree commit diff
path: root/dot_zshenv
diff options
context:
space:
mode:
authorAlen <alen@dotfiles.xyz>2025-01-19 19:35:20 +0400
committerAlen <alen@dotfiles.xyz>2025-01-19 19:35:20 +0400
commit8175cd266c932a3a75832e6fba9f5f1d8497974d (patch)
tree9c477ac59de8ad3e147aedef6c9e8e1df03449da /dot_zshenv
parent534899e2986732a569d15f231637447833a360b0 (diff)
Only set up brew if present
Diffstat (limited to 'dot_zshenv')
-rw-r--r--dot_zshenv14
1 files changed, 8 insertions, 6 deletions
diff --git a/dot_zshenv b/dot_zshenv
index 0b222c7..ad5db84 100644
--- a/dot_zshenv
+++ b/dot_zshenv
@@ -75,12 +75,14 @@ export BAT_CONFIG_FILE="${XDG_CONFIG_HOME:-${HOME}/.config}/bat/config"
 HOMEBREW_BUNDLE_FILE_GLOBAL="${XDG_CONFIG_HOME:-${HOME}/.config}/Brewfile"
 
 # Homebrew to PATH - also set in brew.plugin.zsh, but de-duped
-export HOMEBREW_PREFIX=/opt/homebrew
-if [[ -d "${HOMEBREW_PREFIX}/sbin" ]]; then
-    export PATH="${HOMEBREW_PREFIX}/sbin:${PATH}"
-fi
-if [[ -d "${HOMEBREW_PREFIX}/bin" ]]; then
-    export PATH="${HOMEBREW_PREFIX}/bin:${PATH}"
+if [[ -d "/opt/homebrew" ]]; then
+    export HOMEBREW_PREFIX="/opt/homebrew"
+    if [[ -d "${HOMEBREW_PREFIX}/sbin" ]]; then
+        export PATH="${HOMEBREW_PREFIX}/sbin:${PATH}"
+    fi
+    if [[ -d "${HOMEBREW_PREFIX}/bin" ]]; then
+        export PATH="${HOMEBREW_PREFIX}/bin:${PATH}"
+    fi
 fi
 
 # JetBrains Toolbox to PATH