From b437b29751822ad11f24431d126b36d943fa7992 Mon Sep 17 00:00:00 2001 From: Marc Date: Sat, 30 Oct 2021 22:56:04 +0200 Subject: [PATCH] Add Apple Silicon support --- conf.d/brew.fish | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/conf.d/brew.fish b/conf.d/brew.fish index 7c16fb0..d86167b 100644 --- a/conf.d/brew.fish +++ b/conf.d/brew.fish @@ -1,24 +1,20 @@ -if type -q brew - set -l brew_paths /opt/homebrew/bin /usr/local/bin /usr/bin /bin /opt/homebrew/sbin /usr/local/sbin /usr/sbin /sbin +set -l brew_paths /opt/homebrew/bin /usr/local/bin /usr/bin /bin /opt/homebrew/sbin /usr/local/sbin /usr/sbin /sbin - # Append all existing brew paths to PATH - set -l existing_brew_paths - for brew_path in $brew_paths - if test -d $brew_path - set PATH $PATH $brew_path - set existing_brew_paths $existing_brew_paths $brew_path - end +# Append all existing brew paths to PATH +set -l existing_brew_paths +for brew_path in $brew_paths + if test -d $brew_path + set PATH $PATH $brew_path + set existing_brew_paths $existing_brew_paths $brew_path end +end - # Remove brew paths from tail to head that were not recently added - set -l number_of_paths_to_ignore (math (count $PATH) - (count $existing_brew_paths)) - for i in (seq (count $PATH))[-1..1] - if test $i -le $number_of_paths_to_ignore - if contains $PATH[$i] $brew_paths - set -e PATH[$i] - end +# Remove brew paths from tail to head that were not recently added +set -l number_of_paths_to_ignore (math (count $PATH) - (count $existing_brew_paths)) +for i in (seq (count $PATH))[-1..1] + if test $i -le $number_of_paths_to_ignore + if contains $PATH[$i] $brew_paths + set -e PATH[$i] end end -else - echo "Please install 'brew' first!" end