Skip to content

Commit

Permalink
feat(fish/config): add homebrew paths for arm64 and x86_64
Browse files Browse the repository at this point in the history
This commit adds the homebrew paths to the fish shell configuration.
It checks the machine architecture and adds the appropriate homebrew
path. For arm64, it adds /opt/homebrew/bin and for x86_64, it adds
/usr/local/bin. This ensures that the correct homebrew binaries are
used depending on the machine architecture.
  • Loading branch information
ryoppippi committed Jul 15, 2024
1 parent a7b4e6d commit 53592ae
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions fish/config.fish
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ fish_add_path /usr/local/opt/curl/bin
set -gx USE_CCACHE 1
set -gx CCACHE_DIR $HOME/.ccache

# brew
fish_add_path /opt/homebrew/bin

# js/ts
## bun
fish_add_path $HOME/.bun/bin
Expand Down Expand Up @@ -80,6 +83,14 @@ if test "$FISH_CONFIG" -nt "$CONFIG_CACHE"
mkdir -p $FISH_CACHE_DIR
echo '' >$CONFIG_CACHE

# homebrew
if test (uname -m) = arm64
echo $(/opt/homebrew/bin/brew shellenv) >>$CONFIG_CACHE
echo "set -gx PATH /opt/homebrew/opt/llvm/bin $PATH" >>$CONFIG_CACHE
else
echo $(/usr/local/bin/brew shellenv) >>$CONFIG_CACHE
end

# xcode
echo "fish_add_path $(ensure_installed xcode-select -p)/usr/bin" >>$CONFIG_CACHE
echo "set -gx SDKROOT $(ensure_installed xcrun --sdk macosx --show-sdk-path)" >>$CONFIG_CACHE
Expand Down

0 comments on commit 53592ae

Please sign in to comment.