Commit a8df89f 1 parent 80bba0d commit a8df89f Copy full SHA for a8df89f
File tree 1 file changed +29
-2
lines changed
1 file changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,10 @@ should_install_homebrew() {
16
16
! [[ -e " ${HOMEBREW_PREFIX} /bin/brew" ]]
17
17
}
18
18
19
+ should_add_homebrew_to_path () {
20
+ ! [[ " :${PATH} :" = * " :${HOMEBREW_PREFIX} /bin:" * ]]
21
+ }
22
+
19
23
no_python3 () {
20
24
! [[ -e " /usr/local/bin/2to3" ]]
21
25
}
@@ -59,16 +63,39 @@ system_setup() {
59
63
else
60
64
if [[ " $( /usr/bin/uname -m) " == " arm64" ]]
61
65
then
62
- export HOMEBREW_PREFIX=" /opt/homebrew"
66
+ HOMEBREW_PREFIX=" /opt/homebrew"
63
67
else
64
- export HOMEBREW_PREFIX=" /usr/local"
68
+ HOMEBREW_PREFIX=" /usr/local"
65
69
fi
66
70
fi
67
71
68
72
if should_install_homebrew
69
73
then
70
74
/bin/bash -c " $( curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh) "
71
75
fi
76
+
77
+ if should_add_homebrew_to_path
78
+ then
79
+ case " ${SHELL} " in
80
+ * /bash* )
81
+ if [[ -r " ${HOME} /.bash_profile" ]]
82
+ then
83
+ shell_profile=" ${HOME} /.bash_profile"
84
+ else
85
+ shell_profile=" ${HOME} /.profile"
86
+ fi
87
+ ;;
88
+ * /zsh* )
89
+ shell_profile=" ${HOME} /.zprofile"
90
+ ;;
91
+ * )
92
+ shell_profile=" ${HOME} /.profile"
93
+ ;;
94
+ esac
95
+
96
+ (echo; echo ' eval "\$(${HOMEBREW_PREFIX}/bin/brew shellenv)"' ) >> ${shell_profile}
97
+ eval " \$ (${HOMEBREW_PREFIX} /bin/brew shellenv)"
98
+ fi
72
99
73
100
if should_install_ansible
74
101
then
You can’t perform that action at this time.
0 commit comments