From 6d786e7dbbeb9c1c473ec80aabbf4a61ecaca1a1 Mon Sep 17 00:00:00 2001 From: Xu Cheng Date: Tue, 13 Jan 2015 21:03:46 +0800 Subject: [PATCH] brew-config: show realpath for pyenv and rbenv Closes Homebrew/homebrew#35819. Signed-off-by: Mike McQuaid --- Library/Homebrew/cmd/config.rb | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/cmd/config.rb b/Library/Homebrew/cmd/config.rb index 7d4d8cfc32..4caa3afec2 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