From fb7f5f7d67d1a88718dde2e87010d1b4b1eb2409 Mon Sep 17 00:00:00 2001 From: Tony Blyler Date: Mon, 3 Jun 2024 10:06:14 -0400 Subject: [PATCH] Initialize homebrew before asdf on MacOS --- chezmoi/dot_zshenv | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/chezmoi/dot_zshenv b/chezmoi/dot_zshenv index c026821..85982d7 100644 --- a/chezmoi/dot_zshenv +++ b/chezmoi/dot_zshenv @@ -2,6 +2,24 @@ export PATH="/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:${PATH export LANG='en_US.UTF-8' export PAGER='less -RF' +if [[ "$OSTYPE" =~ ^darwin ]]; then + if [ -x /opt/homebrew/bin/brew ]; then + eval "$(/opt/homebrew/bin/brew shellenv)" + fi + + # Use GNU tools if they're installed :D + for d in "${HOMEBREW_PREFIX}/opt"/*/libexec/gnubin; do + export PATH="$d:$PATH" + done + + for TEST_PATH in /Applications/Tailscale{.localized,}/Tailscale.app/Contents/MacOS/Tailscale; do + if [ -x "$TEST_PATH" ]; then + alias tailscale="$TEST_PATH" + break + fi + done +fi + if [ -r ~/.asdf/asdf.sh ]; then ASDF_FORCE_PREPEND=1 . ~/.asdf/asdf.sh fi @@ -35,24 +53,6 @@ fi export VISUAL="${EDITOR}" -if [[ "$OSTYPE" =~ ^darwin ]]; then - if [ -x /opt/homebrew/bin/brew ]; then - eval "$(/opt/homebrew/bin/brew shellenv)" - fi - - # Use GNU tools if they're installed :D - for d in "${HOMEBREW_PREFIX}/opt"/*/libexec/gnubin; do - export PATH="$d:$PATH" - done - - for TEST_PATH in /Applications/Tailscale{.localized,}/Tailscale.app/Contents/MacOS/Tailscale; do - if [ -x "$TEST_PATH" ]; then - alias tailscale="$TEST_PATH" - break - fi - done -fi - if [ -d "${HOME}/bin" ]; then export PATH="${HOME}/bin:${PATH}" fi