mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
brew.rb: Don't ask xcrun
for output if no CLT is installed (#334)
This avoids `xcrun` popups when installing Homebrew on a non-Xcode non-CLT machine.
This commit is contained in:
parent
8d64b6a02d
commit
2ca6dbbe9d
@ -137,7 +137,8 @@ export HOMEBREW_USER_AGENT_CURL
|
|||||||
|
|
||||||
if [[ -n "$HOMEBREW_OSX" ]]
|
if [[ -n "$HOMEBREW_OSX" ]]
|
||||||
then
|
then
|
||||||
if [[ "$('/usr/bin/xcode-select' --print-path)" = "/" ]]
|
XCODE_SELECT_PATH=$('/usr/bin/xcode-select' --print-path 2>/dev/null)
|
||||||
|
if [[ "$XCODE_SELECT_PATH" = "/" ]]
|
||||||
then
|
then
|
||||||
odie <<EOS
|
odie <<EOS
|
||||||
Your xcode-select path is currently set to '/'.
|
Your xcode-select path is currently set to '/'.
|
||||||
@ -149,6 +150,10 @@ Otherwise, you should:
|
|||||||
EOS
|
EOS
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Don't check xcrun if Xcode and the CLT aren't installed, as that opens
|
||||||
|
# a popup window asking the user to install the CLT
|
||||||
|
if [[ -n "$XCODE_SELECT_PATH" ]]
|
||||||
|
then
|
||||||
XCRUN_OUTPUT="$(/usr/bin/xcrun clang 2>&1)"
|
XCRUN_OUTPUT="$(/usr/bin/xcrun clang 2>&1)"
|
||||||
XCRUN_STATUS="$?"
|
XCRUN_STATUS="$?"
|
||||||
|
|
||||||
@ -159,6 +164,7 @@ You have not agreed to the Xcode license. Please resolve this by running:
|
|||||||
sudo xcodebuild -license
|
sudo xcodebuild -license
|
||||||
EOS
|
EOS
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Many Pathname operations use getwd when they shouldn't, and then throw
|
# Many Pathname operations use getwd when they shouldn't, and then throw
|
||||||
|
Loading…
x
Reference in New Issue
Block a user