aboutsummaryrefslogtreecommitdiffstats
path: root/Library/ENV
diff options
context:
space:
mode:
authorMax Howell2012-08-31 10:21:06 -0400
committerMax Howell2012-08-31 10:22:11 -0400
commit2856a97ce37e63b27f2b1bd00f7ea7c0378b0724 (patch)
tree87d1c15e5bd746a1b5749e0ecfe555e767c06344 /Library/ENV
parentb02455487262a3e68bfa1612d324978bdf90baf6 (diff)
downloadbrew-2856a97ce37e63b27f2b1bd00f7ea7c0378b0724.tar.bz2
Refs Homebrew/homebrew#14558. Try to find tools when xcrun fails.
Diffstat (limited to 'Library/ENV')
-rwxr-xr-xLibrary/ENV/4.3/xcrun19
1 files changed, 18 insertions, 1 deletions
diff --git a/Library/ENV/4.3/xcrun b/Library/ENV/4.3/xcrun
index 3d2dd642e..49d99a644 100755
--- a/Library/ENV/4.3/xcrun
+++ b/Library/ENV/4.3/xcrun
@@ -4,7 +4,24 @@
# NOTE only works if they call xcrun without a full-path. Cross your fingers!
if [ $HOMEBREW_SDKROOT ]; then
- exec /usr/bin/xcrun "$@"
+ arg0="$1"
+ shift
+
+ path=$(/usr/bin/xcrun -find $arg0)
+ [ -x "$path" ] && exec "$path" "$@"
+
+ # Nuts, Xcode is not setup properly or something.
+ # Try to find the tools anyway!
+ path="/Applications/Xcode.app/Contents/Developer/usr/bin/$arg0"
+ [ -x "$path" ] && exec "$path" "$@"
+ path="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/$arg0"
+ [ -x "$path" ] && exec "$path" "$@"
+
+ echo "Your Xcode setup is not ready. You need to either:"
+ echo " sudo xcode-select -switch /path/to/Xcode.app"
+ echo "or:"
+ echo " xcodebuild -license"
+ exit 1
else
cmd="$1"
shift