File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -231,6 +231,13 @@ export HOMEBREW_NO_ANALYTICS_MESSAGE_OUTPUT=1
231231
232232unset HAVE_SUDO_ACCESS # unset this from the environment
233233
234+ # create paths.d file for /opt/homebrew installs
235+ # (/usr/local/bin is already in the PATH)
236+ if [[ -d " /etc/paths.d" && " ${HOMEBREW_PREFIX} " != " /usr/local" && -x " $( command -v tee) " ]]
237+ then
238+ ADD_PATHS_D=1
239+ fi
240+
234241have_sudo_access () {
235242 if [[ ! -x " /usr/bin/sudo" ]]
236243 then
@@ -618,6 +625,10 @@ echo "${HOMEBREW_PREFIX}/share/man/man1/brew.1"
618625echo " ${HOMEBREW_PREFIX} /share/zsh/site-functions/_brew"
619626echo " ${HOMEBREW_PREFIX} /etc/bash_completion.d/brew"
620627echo " ${HOMEBREW_REPOSITORY} "
628+ if [[ -n " ${ADD_PATHS_D-} " ]]
629+ then
630+ echo " /etc/paths.d/homebrew"
631+ fi
621632
622633# Keep relatively in sync with
623634# https://github.com/Homebrew/brew/blob/HEAD/Library/Homebrew/keg.rb
@@ -1011,9 +1022,7 @@ ohai "Downloading and installing Homebrew..."
10111022 execute " ${HOMEBREW_PREFIX} /bin/brew" " update" " --force" " --quiet"
10121023) || exit 1
10131024
1014- # create paths.d file for /opt/homebrew installs
1015- # (/usr/local/bin is already in the PATH)
1016- if [[ -d " /etc/paths.d" && " ${HOMEBREW_PREFIX} " != " /usr/local" && -x " $( command -v tee) " ]]
1025+ if [[ -n " ${ADD_PATHS_D-} " ]]
10171026then
10181027 execute_sudo " ${MKDIR[@]} " /etc/paths.d
10191028 echo " ${HOMEBREW_PREFIX} /bin" | execute_sudo tee /etc/paths.d/homebrew
You can’t perform that action at this time.
0 commit comments