fix(fish): check a few homebrew paths that created errors

This commit is contained in:
Stefan Imhoff
2025-03-14 16:13:55 +01:00
parent a7caeae35a
commit 2ae75a7196

View File

@@ -27,13 +27,24 @@ if command -v nvim >/dev/null 2>&1
set -x GIT_EDITOR nvim set -x GIT_EDITOR nvim
end end
# Check for Homebrew path # Determine Homebrew prefix based on architecture
if test (uname -m) = arm64 if test (uname -m) = arm64
set brew_prefix /opt/homebrew set brew_prefix /opt/homebrew
else else
set brew_prefix /usr/local set brew_prefix /usr/local
end 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 set -x HOMEBREW_NO_AUTO_UPDATE 1
# XDG base directory specification # XDG base directory specification
@@ -85,9 +96,6 @@ if test -f $asdf_path/libexec/asdf.fish
set -x PATH $HOME/.asdf/shims $PATH set -x PATH $HOME/.asdf/shims $PATH
end end
# Homebrew
eval "$($brew_prefix/bin/brew shellenv)"
# Volta # Volta
set -x PATH $PATH $VOLTA_HOME/bin set -x PATH $PATH $VOLTA_HOME/bin