Skip to content

Commit

Permalink
Add Apple Silicon support
Browse files Browse the repository at this point in the history
  • Loading branch information
lunij authored and scorphus committed Oct 30, 2021
1 parent 3ad9d0c commit b437b29
Showing 1 changed file with 14 additions and 18 deletions.
32 changes: 14 additions & 18 deletions conf.d/brew.fish
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit b437b29

Please sign in to comment.