brew.sh: Allow developers to specify curl/git paths
This introduces the HOMEBREW_CURL_PATH and HOMEBREW_GIT_PATH variables, which are used to populate HOMEBREW_CURL and HOMEBREW_GIT, respectively, when in developer mode (HOMEBREW_DEVELOPER). Both paths are expected to be valid executables and must have the executable bit set.
This commit is contained in:
parent
a11039d854
commit
479f82904b
@ -129,6 +129,11 @@ else
|
||||
HOMEBREW_CURL="curl"
|
||||
fi
|
||||
|
||||
if [[ -n "$HOMEBREW_DEVELOPER" && -x "$HOMEBREW_CURL_PATH" ]]
|
||||
then
|
||||
HOMEBREW_CURL="$HOMEBREW_CURL_PATH"
|
||||
fi
|
||||
|
||||
if [[ -n "$HOMEBREW_FORCE_BREWED_GIT" &&
|
||||
-x "$HOMEBREW_PREFIX/opt/git/bin/git" ]] &&
|
||||
"$HOMEBREW_PREFIX/opt/git/bin/git" --version >/dev/null
|
||||
@ -138,6 +143,11 @@ else
|
||||
HOMEBREW_GIT="git"
|
||||
fi
|
||||
|
||||
if [[ -n "$HOMEBREW_DEVELOPER" && -x "$HOMEBREW_GIT_PATH" ]]
|
||||
then
|
||||
HOMEBREW_GIT="$HOMEBREW_GIT_PATH"
|
||||
fi
|
||||
|
||||
HOMEBREW_USER_AGENT="$HOMEBREW_PRODUCT/$HOMEBREW_USER_AGENT_VERSION ($HOMEBREW_SYSTEM; $HOMEBREW_PROCESSOR $HOMEBREW_OS_USER_AGENT_VERSION)"
|
||||
HOMEBREW_CURL_VERSION="$("$HOMEBREW_CURL" --version 2>/dev/null | head -n1 | awk '{print $1"/"$2}')"
|
||||
HOMEBREW_USER_AGENT_CURL="$HOMEBREW_USER_AGENT $HOMEBREW_CURL_VERSION"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user