Use set -e/set +e instead of odie
This commit is contained in:
parent
22bc5a94e7
commit
7c4b1841bc
@ -368,30 +368,27 @@ user account:
|
|||||||
EOS
|
EOS
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# we may want to use a Homebrew curl
|
set -e
|
||||||
if [[ -n "$HOMEBREW_FORCE_BREWED_CURL" &&
|
if [[ -n "$HOMEBREW_FORCE_BREWED_CURL" &&
|
||||||
! -x "$HOMEBREW_PREFIX/opt/curl/bin/curl" ]]
|
! -x "$HOMEBREW_PREFIX/opt/curl/bin/curl" ]]
|
||||||
then
|
then
|
||||||
ohai "Installing Homebrew cURL"
|
ohai "Installing Homebrew cURL"
|
||||||
brew install curl || odie "Failed to install cURL"
|
brew install curl
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! git --version &>/dev/null ||
|
if ! git --version &>/dev/null ||
|
||||||
[[ -n "$HOMEBREW_FORCE_BREWED_GIT" &&
|
[[ -n "$HOMEBREW_FORCE_BREWED_GIT" &&
|
||||||
! -x "$HOMEBREW_PREFIX/opt/git/bin/git" ]]
|
! -x "$HOMEBREW_PREFIX/opt/git/bin/git" ]]
|
||||||
then
|
then
|
||||||
# we cannot install brewed git if homebrew/core is unavailable.
|
ohai "Installing Homebrew Git"
|
||||||
if [[ -d "$HOMEBREW_LIBRARY/Taps/homebrew/homebrew-core" ]]
|
brew install git
|
||||||
then
|
|
||||||
ohai "Installing Homebrew Git"
|
|
||||||
brew install git || odie "Failed to install Git"
|
|
||||||
fi
|
|
||||||
unset GIT_EXECUTABLE
|
unset GIT_EXECUTABLE
|
||||||
if ! git --version &>/dev/null
|
if ! git --version &>/dev/null
|
||||||
then
|
then
|
||||||
odie "Git must be installed and in your PATH!"
|
odie "Git must be installed and in your PATH!"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
set +e
|
||||||
export GIT_TERMINAL_PROMPT="0"
|
export GIT_TERMINAL_PROMPT="0"
|
||||||
export GIT_SSH_COMMAND="ssh -oBatchMode=yes"
|
export GIT_SSH_COMMAND="ssh -oBatchMode=yes"
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user