aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorMike McQuaid2011-05-18 16:10:31 +0100
committerMike McQuaid2011-05-18 17:04:00 +0100
commitf8127143cfdf44345853ef9292c9e08035324fff (patch)
treeb02189ac1b875dc19f5fd65db8390dc712411d7d /Library/Homebrew
parentdae5a4477b0c5a08409b4db02bd0f5aff58bd72c (diff)
downloadbrew-f8127143cfdf44345853ef9292c9e08035324fff.tar.bz2
Create method for accessing Xcode version.
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/cmd/--config.rb3
-rw-r--r--Library/Homebrew/utils.rb5
2 files changed, 6 insertions, 2 deletions
diff --git a/Library/Homebrew/cmd/--config.rb b/Library/Homebrew/cmd/--config.rb
index 7876dfc53..fe4379395 100644
--- a/Library/Homebrew/cmd/--config.rb
+++ b/Library/Homebrew/cmd/--config.rb
@@ -18,8 +18,7 @@ module Homebrew extend self
end
def xcode_version
- `xcodebuild -version 2>&1` =~ /Xcode (\d(\.\d)*)/
- $1
+ @xcode_version || MacOS.xcode_version
end
def llvm_recommendation
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb
index dd5707e66..74d5d0f91 100644
--- a/Library/Homebrew/utils.rb
+++ b/Library/Homebrew/utils.rb
@@ -271,6 +271,11 @@ module MacOS extend self
end
end
+ def xcode_version
+ `xcodebuild -version 2>&1` =~ /Xcode (\d(\.\d)*)/
+ $1
+ end
+
def llvm_build_version
unless xcode_prefix.to_s.empty?
llvm_gcc_path = xcode_prefix/"usr/bin/llvm-gcc"