Skip to content

Commit 228188f

Browse files
authored
Merge pull request #1000 from gromgit/fix-sudo
2 parents efda6e8 + 165fefb commit 228188f

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

install.sh

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,22 +1019,22 @@ ohai "Downloading and installing Homebrew..."
10191019
) || exit 1
10201020
fi
10211021

1022+
if [[ -n "${ADD_PATHS_D-}" ]]
1023+
then
1024+
execute_sudo "${MKDIR[@]}" /etc/paths.d
1025+
echo "${HOMEBREW_PREFIX}/bin" | execute_sudo tee /etc/paths.d/homebrew
1026+
execute_sudo "${CHOWN[@]}" root:wheel /etc/paths.d/homebrew
1027+
execute_sudo "${CHMOD[@]}" "a+r" /etc/paths.d/homebrew
1028+
elif [[ ":${PATH}:" != *":${HOMEBREW_PREFIX}/bin:"* ]]
1029+
then
1030+
warn "${HOMEBREW_PREFIX}/bin is not in your PATH.
1031+
Instructions on how to configure your shell for Homebrew
1032+
can be found in the 'Next steps' section below."
1033+
fi
1034+
10221035
execute "${HOMEBREW_PREFIX}/bin/brew" "update" "--force" "--quiet"
10231036
) || exit 1
10241037

1025-
if [[ -n "${ADD_PATHS_D-}" ]]
1026-
then
1027-
execute_sudo "${MKDIR[@]}" /etc/paths.d
1028-
echo "${HOMEBREW_PREFIX}/bin" | execute_sudo tee /etc/paths.d/homebrew
1029-
execute_sudo "${CHOWN[@]}" root:wheel /etc/paths.d/homebrew
1030-
execute_sudo "${CHMOD[@]}" "a+r" /etc/paths.d/homebrew
1031-
elif [[ ":${PATH}:" != *":${HOMEBREW_PREFIX}/bin:"* ]]
1032-
then
1033-
warn "${HOMEBREW_PREFIX}/bin is not in your PATH.
1034-
Instructions on how to configure your shell for Homebrew
1035-
can be found in the 'Next steps' section below."
1036-
fi
1037-
10381038
ohai "Installation successful!"
10391039
echo
10401040

0 commit comments

Comments
 (0)