File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -1009,7 +1009,14 @@ ohai "Downloading and installing Homebrew..."
1009
1009
execute " ${HOMEBREW_PREFIX} /bin/brew" " update" " --force" " --quiet"
1010
1010
) || exit 1
1011
1011
1012
- if [[ " :${PATH} :" != * " :${HOMEBREW_PREFIX} /bin:" * ]]
1012
+ # create paths.d file for /opt/homebrew installs
1013
+ # (/usr/local/bin is already in the PATH)
1014
+ if [[ -d " /etc/paths.d" && " ${HOMEBREW_PREFIX} " != " /usr/local" && -x " $( command -v tee) " ]]
1015
+ then
1016
+ execute_sudo " ${MKDIR[@]} " /etc/paths.d
1017
+ echo " ${HOMEBREW_PREFIX} /bin" | execute_sudo tee /etc/paths.d/homebrew
1018
+ execute_sudo " ${CHOWN[@]} " root:wheel /etc/paths.d/homebrew
1019
+ elif [[ " :${PATH} :" != * " :${HOMEBREW_PREFIX} /bin:" * ]]
1013
1020
then
1014
1021
warn " ${HOMEBREW_PREFIX} /bin is not in your PATH.
1015
1022
Instructions on how to configure your shell for Homebrew
Original file line number Diff line number Diff line change 329
329
fi
330
330
echo " ${HOMEBREW_CELLAR} "
331
331
echo " ${HOMEBREW_PREFIX} /Caskroom"
332
+ echo " /etc/paths.d/homebrew"
332
333
333
334
[[ -n ${opt_skip_cache_and_logs} ]] || cat << -EOS
334
335
${HOME} /Library/Caches/Homebrew
You can’t perform that action at this time.
0 commit comments