From 534899e2986732a569d15f231637447833a360b0 Mon Sep 17 00:00:00 2001
From: Alen <alen@dotfiles.xyz>
Date: Sun, 19 Jan 2025 19:33:32 +0400
Subject: Tidy up PATH  bootstrapping, set up core brew PATHs in zshenv

---
 dot_local/share/zsh/brew/brew.plugin.zsh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'dot_local')

diff --git a/dot_local/share/zsh/brew/brew.plugin.zsh b/dot_local/share/zsh/brew/brew.plugin.zsh
index e929174..8d9113a 100644
--- a/dot_local/share/zsh/brew/brew.plugin.zsh
+++ b/dot_local/share/zsh/brew/brew.plugin.zsh
@@ -1,13 +1,13 @@
 # Set up brew
-if [[ -f /opt/homebrew/bin/brew ]]; then
+if [[ -v HOMEBREW_PREFIX ]] && [[ -f "${HOMEBREW_PREFIX}/bin/brew" ]]; then
     export HOMEBREW_NO_ENV_HINTS=1
     export HOMEBREW_NO_ANALYTICS=1
-    eval "$(/opt/homebrew/bin/brew shellenv)"
-    fpath=("/opt/homebrew/share/zsh/site-functions" $fpath)
+    eval "$(${HOMEBREW_PREFIX}/bin/brew shellenv)"
+    fpath=("${HOMEBREW_PREFIX}/share/zsh/site-functions" $fpath)
 
     # Prefer GNU versions of certain tools
     local tool_bin
-    for tool_bin in /opt/homebrew/opt/*/libexec/gnubin(N); do
+    for tool_bin in "${HOMEBREW_PREFIX}"/opt/*/libexec/gnubin(N); do
         if [[ "${tool_bin}" == */gsed/* ]]; then
             continue  # Alias to gnu-sed
         fi
-- 
cgit 1.4.1-2-gfad0