Make compatible with macOS Ventura 13.1
dblume

dblume commited on 2023-02-15 16:42:07
Showing 1 changed files, with 15 additions and 0 deletions.

... ...
@@ -1,6 +1,9 @@
1 1
 # ~/.bash_profile: executed by bash for login shells.
2 2
 
3 3
 if [ -f "${HOME}/.bashrc" ]; then
4
+    if [[ $(uname -s) == Darwin* ]]; then
5
+        eval "$(/opt/homebrew/bin/brew shellenv)"
6
+    fi
4 7
     source "${HOME}/.bashrc"
5 8
 fi
6 9
 if [[ $(uname -s) == Darwin* ]]; then
... ...
@@ -15,7 +18,19 @@ if [[ $(uname -s) == Darwin* ]]; then
15 18
         alias ctags="$(brew --prefix)/bin/ctags"
16 19
     fi
17 20
     # Set default names for GNU grep, sed and find
21
+    if [[ -d "/usr/local/opt/grep/libexec/gnubin" ]]; then  # old path
18 22
         prepend_to_path /usr/local/opt/grep/libexec/gnubin
23
+    elif [[ -d "/opt/homebrew/opt/grep/libexec/gnubin" ]]; then
24
+        prepend_to_path /opt/homebrew/opt/grep/libexec/gnubin
25
+    fi
26
+    if [[ -d "/usr/local/opt/gnu-sed/libexec/gnubin" ]]; then  # old path
19 27
         prepend_to_path /usr/local/opt/gnu-sed/libexec/gnubin
28
+    elif [[ -d "/opt/homebrew/opt/gnu-sed/libexec/gnubin" ]]; then
29
+        prepend_to_path /opt/homebrew/opt/gnu-sed/libexec/gnubin
30
+    fi
31
+    if [[ -d "/usr/local/opt/findutils/libexec/gnubin" ]]; then  # old path
20 32
         prepend_to_path /usr/local/opt/findutils/libexec/gnubin
33
+    elif [[ -d "/opt/homebrew/opt/findutils/libexec/gnubin" ]]; then
34
+        prepend_to_path /opt/homebrew/opt/findutils/libexec/gnubin
35
+    fi
21 36
 fi
22 37