diff options
| author | Mike McQuaid | 2011-05-18 16:10:31 +0100 |
|---|---|---|
| committer | Mike McQuaid | 2011-05-18 17:04:00 +0100 |
| commit | f8127143cfdf44345853ef9292c9e08035324fff (patch) | |
| tree | b02189ac1b875dc19f5fd65db8390dc712411d7d /Library/Homebrew | |
| parent | dae5a4477b0c5a08409b4db02bd0f5aff58bd72c (diff) | |
| download | brew-f8127143cfdf44345853ef9292c9e08035324fff.tar.bz2 | |
Create method for accessing Xcode version.
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/cmd/--config.rb | 3 | ||||
| -rw-r--r-- | Library/Homebrew/utils.rb | 5 |
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" |
