From 156475674861f4e8d3135cad092d4145813a386f Mon Sep 17 00:00:00 2001 From: Daniele Sluijters Date: Sun, 3 Nov 2013 17:11:35 +0100 Subject: [PATCH] pyenv: Detect $PYENV_ROOT and act accordingly. This also fixes issues for Homebrew users if the followed the caveat to set PYENV_ROOT to use the homebrew created directories. --- plugins/pyenv/pyenv.load | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/plugins/pyenv/pyenv.load b/plugins/pyenv/pyenv.load index b82afc9..b48aa79 100644 --- a/plugins/pyenv/pyenv.load +++ b/plugins/pyenv/pyenv.load @@ -1,7 +1,15 @@ -if test -d $HOME/.pyenv/bin - set PATH $HOME/.pyenv/bin $PATH -end - -if test -d $HOME/.pyenv/shims - set PATH $HOME/.pyenv/shims $PATH +if test -n "$PYENV_ROOT" + if test -d $PYENV_ROOT/bin + set PATH $PYENV_ROOT/bin $PATH + end + if test -d $PYENV_ROOT/shims + set $PATH $PYENV_ROOT/shims $PATH + end +else + if test -d $HOME/.pyenv/bin + set PATH $HOME/.pyenv/bin $PATH + end + if test -d $HOME/.pyenv/shims + set PATH $HOME/.pyenv/shims $PATH + end end