brew-config: show realpath for pyenv and rbenv

Closes Homebrew/homebrew#35819.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Xu Cheng 2015-01-13 21:03:46 +08:00 committed by Mike McQuaid
parent c6dee041eb
commit 6d786e7dbb

View File

@ -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