mirror of
https://github.com/natelandau/shell-scripting-templates.git
synced 2025-11-08 13:13:47 -05:00
don't add homebrew to PATH unless macOS
This commit is contained in:
@@ -493,12 +493,21 @@ _homebrewPath_() {
|
|||||||
|
|
||||||
! declare -f "_setPATH_" &>/dev/null && fatal "${FUNCNAME[0]} needs function _setPATH_"
|
! declare -f "_setPATH_" &>/dev/null && fatal "${FUNCNAME[0]} needs function _setPATH_"
|
||||||
|
|
||||||
if _setPATH_ "/usr/local/bin" "/opt/homebrew/bin"; then
|
if _uname=$(command -v uname); then
|
||||||
return 0
|
if "${_uname}" | tr '[:upper:]' '[:lower:]' | grep -q 'darwin'; then
|
||||||
|
if _setPATH_ "/usr/local/bin" "/opt/homebrew/bin"; then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
return 1
|
if _setPATH_ "/usr/local/bin" "/opt/homebrew/bin"; then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_parseOptions_() {
|
_parseOptions_() {
|
||||||
|
|||||||
@@ -96,10 +96,19 @@ _homebrewPath_() {
|
|||||||
|
|
||||||
! declare -f "_setPATH_" &>/dev/null && fatal "${FUNCNAME[0]} needs function _setPATH_"
|
! declare -f "_setPATH_" &>/dev/null && fatal "${FUNCNAME[0]} needs function _setPATH_"
|
||||||
|
|
||||||
if _setPATH_ "/usr/local/bin" "/opt/homebrew/bin"; then
|
if _uname=$(command -v uname); then
|
||||||
return 0
|
if "${_uname}" | tr '[:upper:]' '[:lower:]' | grep -q 'darwin'; then
|
||||||
|
if _setPATH_ "/usr/local/bin" "/opt/homebrew/bin"; then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
return 1
|
if _setPATH_ "/usr/local/bin" "/opt/homebrew/bin"; then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user