aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/doctor.rb
diff options
context:
space:
mode:
authorMax Howell2012-08-31 10:20:20 -0400
committerMax Howell2012-08-31 10:22:11 -0400
commitb98c4792d0aeca67df509802d376e866bcf3bcd0 (patch)
tree11a18444a4bf4fbf39e2e5ca8b5faf6d5db2a16e /Library/Homebrew/cmd/doctor.rb
parent1555436f70162a2da6dc0b4b96008c21f1de2a1a (diff)
downloadbrew-b98c4792d0aeca67df509802d376e866bcf3bcd0.tar.bz2
Doctor check for unlicensed Xcode
Checking the license text is probably the most future proofed method. Though for future reference other possible methods are listed in the below ticket. Closes Homebrew/homebrew#14558.
Diffstat (limited to 'Library/Homebrew/cmd/doctor.rb')
-rw-r--r--Library/Homebrew/cmd/doctor.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb
index 0786d7c99..39fed18d9 100644
--- a/Library/Homebrew/cmd/doctor.rb
+++ b/Library/Homebrew/cmd/doctor.rb
@@ -925,6 +925,16 @@ def check_os_version
end
end
+ def check_xcode_license_approved
+ # If the user installs Xcode-only, they have to approve the
+ # license or no "xc*" tool will work.
+ <<-EOS.undent if `/usr/bin/xcrun clang 2>&1` =~ /license/ and not $?.success?
+ You have not agreed to the Xcode license.
+ Builds will fail! Agree to the license by opening Xcode.app or running:
+ xcodebuild -license
+ EOS
+ end
+
end # end class Checks
module Homebrew extend self