aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2011-05-18 16:10:31 +0100
committerMike McQuaid2011-05-18 17:04:00 +0100
commit58b7a5edbe88504b0e9fe80b92dc278035f856d8 (patch)
tree4625c19248b162c3c8859dfe82e7f4f08a51d943 /Library
parent66f77a3e62bba97c37925dea933a882e5878d613 (diff)
downloadhomebrew-58b7a5edbe88504b0e9fe80b92dc278035f856d8.tar.bz2
Create method for accessing Xcode version.
Diffstat (limited to 'Library')
-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"