aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXu Cheng2015-01-13 21:03:46 +0800
committerMike McQuaid2015-01-17 18:48:34 +0100
commite3873ed98ec3310f601a5991cd8eadc84c15be9a (patch)
tree136c77f3815a1ba22384e3479d51081f76fb04e0
parentf44d30a97b3f9964c657e6c499af52c289673872 (diff)
downloadhomebrew-e3873ed98ec3310f601a5991cd8eadc84c15be9a.tar.bz2
brew-config: show realpath for pyenv and rbenv
Closes #35819. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
-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