From 16565707989388368e729906db7b44867bd24b99 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Fri, 5 Aug 2016 10:00:20 -0700 Subject: [PATCH] Fix path_lines function for pyenv --- dotfiles/lib/shellenv/functions.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dotfiles/lib/shellenv/functions.sh b/dotfiles/lib/shellenv/functions.sh index de430703..944ccdfe 100644 --- a/dotfiles/lib/shellenv/functions.sh +++ b/dotfiles/lib/shellenv/functions.sh @@ -1,5 +1,10 @@ function path_lines { - shell_path.py --path-lines "$@" + local python_command + # We need to get a path to the ACTUAL python command because + # pyenv alters PATH before actually executing python, which ends + # up changing PATH in a way that is not desireable. + hash pyenv && python_command="$(pyenv which python)" || python_command="$(which python)" + "$python_command" "$HOME/.lib/python/shell_path.py" --path-lines "$@" } function indirect_expand {