aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorXu Cheng2015-01-13 21:03:46 +0800
committerMike McQuaid2015-01-17 18:48:34 +0100
commit6d786e7dbbeb9c1c473ec80aabbf4a61ecaca1a1 (patch)
tree1d6ff1c6a9fa47cbc2348cde6b0f63e63c99da23 /Library/Homebrew
parentc6dee041eb1d5a4412269a1543eb74415e5a3a88 (diff)
downloadbrew-6d786e7dbbeb9c1c473ec80aabbf4a61ecaca1a1.tar.bz2
brew-config: show realpath for pyenv and rbenv
Closes Homebrew/homebrew#35819. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/cmd/config.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/Library/Homebrew/cmd/config.rb b/Library/Homebrew/cmd/config.rb
index 7d4d8cfc3..4caa3afec 100644
--- a/Library/Homebrew/cmd/config.rb
+++ b/Library/Homebrew/cmd/config.rb
@@ -74,11 +74,21 @@ module Homebrew
end
def describe_python
- describe_path(which 'python')
+ python = which 'python'
+ if %r{/shims/python$} =~ python && which('pyenv')
+ "#{python} => #{Pathname.new(`pyenv which python`.strip).realpath}" rescue describe_path(python)
+ else
+ describe_path(python)
+ end
end
def describe_ruby
- describe_path(which 'ruby')
+ ruby = which 'ruby'
+ if %r{/shims/ruby$} =~ ruby && which('rbenv')
+ "#{ruby} => #{Pathname.new(`rbenv which ruby`.strip).realpath}" rescue describe_path(ruby)
+ else
+ describe_path(ruby)
+ end
end
def hardware