From 2ae75a719617fdc051c2e05b9662d8d48fcd0bc7 Mon Sep 17 00:00:00 2001 From: Stefan Imhoff Date: Fri, 14 Mar 2025 16:13:55 +0100 Subject: [PATCH] fix(fish): check a few homebrew paths that created errors --- config/fish/config.fish | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/config/fish/config.fish b/config/fish/config.fish index e3d3c12..0b40563 100644 --- a/config/fish/config.fish +++ b/config/fish/config.fish @@ -27,13 +27,24 @@ if command -v nvim >/dev/null 2>&1 set -x GIT_EDITOR nvim end -# Check for Homebrew path +# Determine Homebrew prefix based on architecture if test (uname -m) = arm64 set brew_prefix /opt/homebrew else set brew_prefix /usr/local end +# Check if essential commands are in PATH, if not add them +if not command -v podman >/dev/null 2>&1 || not command -v brew >/dev/null 2>&1 + # Add Homebrew to PATH if not already there + if not contains $brew_prefix/bin $PATH + set -x PATH $brew_prefix/bin $PATH + end +end + +# Initialize Homebrew environment +eval "$($brew_prefix/bin/brew shellenv)" + set -x HOMEBREW_NO_AUTO_UPDATE 1 # XDG base directory specification @@ -85,9 +96,6 @@ if test -f $asdf_path/libexec/asdf.fish set -x PATH $HOME/.asdf/shims $PATH end -# Homebrew -eval "$($brew_prefix/bin/brew shellenv)" - # Volta set -x PATH $PATH $VOLTA_HOME/bin