aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/extend/os/mac/development_tools.rb
diff options
context:
space:
mode:
authorMike McQuaid2016-07-06 11:07:24 +0100
committerGitHub2016-07-06 11:07:24 +0100
commit3a127e405e45a4d95a809651553ff4a30ed95e3d (patch)
treef84c3f7b9e572bcdc6faf4f7cc4d4a95cddf5542 /Library/Homebrew/extend/os/mac/development_tools.rb
parent11624b9a7da00448e660f1454121a63b3d401729 (diff)
downloadbrew-3a127e405e45a4d95a809651553ff4a30ed95e3d.tar.bz2
development_tools: add installed? method. (#455)
Diffstat (limited to 'Library/Homebrew/extend/os/mac/development_tools.rb')
-rw-r--r--Library/Homebrew/extend/os/mac/development_tools.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/Library/Homebrew/extend/os/mac/development_tools.rb b/Library/Homebrew/extend/os/mac/development_tools.rb
index b80be4c81..1afab513b 100644
--- a/Library/Homebrew/extend/os/mac/development_tools.rb
+++ b/Library/Homebrew/extend/os/mac/development_tools.rb
@@ -1,3 +1,5 @@
+require "os/mac/xcode"
+
# @private
class DevelopmentTools
class << self
@@ -13,6 +15,13 @@ class DevelopmentTools
end
end
+ # Checks if the user has any developer tools installed, either via Xcode
+ # or the CLT. Convenient for guarding against formula builds when building
+ # is impossible.
+ def installed?
+ MacOS::Xcode.installed? || MacOS::CLT.installed?
+ end
+
def default_compiler
case default_cc
# if GCC 4.2 is installed, e.g. via Tigerbrew, prefer it