Make shell startup less noisy when pyenv missing

This commit is contained in:
Ivan Malison 2016-08-15 11:30:25 -07:00
parent 0ac7e71e3c
commit 83dac3ddeb
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8
2 changed files with 3 additions and 3 deletions

View File

@ -14,7 +14,7 @@ function add_to_path {
# We need to get a path to the ACTUAL python command because # We need to get a path to the ACTUAL python command because
# pyenv alters PATH before actually executing python, which ends # pyenv alters PATH before actually executing python, which ends
# up changing PATH in a way that is not desireable. # up changing PATH in a way that is not desireable.
hash pyenv && python_command="$(pyenv which python)" || python_command="$(which python)" hash pyenv 2>/dev/null && python_command="$(pyenv which python)" || python_command="$(which python)"
result=$($python_command $HOME/.lib/python/shell_path.py --include-assignment "$@") result=$($python_command $HOME/.lib/python/shell_path.py --include-assignment "$@")
eval "$result" eval "$result"
@ -27,7 +27,7 @@ function get_python_scripts_path {
function _setup_env { function _setup_env {
_path_helper _path_helper
time add_to_path "$HOME/.local/bin" "$HOME/.lib/bin" "$HOME/bin" "/usr/local/bin" --before add_to_path "$HOME/.local/bin" "$HOME/.lib/bin" "$HOME/bin" "/usr/local/bin" --before
is_osx && _osx_path_setup is_osx && _osx_path_setup
_java_setup _java_setup
_go_setup _go_setup

View File

@ -3,7 +3,7 @@ function path_lines {
# We need to get a path to the ACTUAL python command because # We need to get a path to the ACTUAL python command because
# pyenv alters PATH before actually executing python, which ends # pyenv alters PATH before actually executing python, which ends
# up changing PATH in a way that is not desireable. # up changing PATH in a way that is not desireable.
hash pyenv && python_command="$(pyenv which python)" || python_command="$(which python)" hash pyenv 2>/dev/null && python_command="$(pyenv which python)" || python_command="$(which python)"
"$python_command" "$HOME/.lib/python/shell_path.py" --path-lines "$@" "$python_command" "$HOME/.lib/python/shell_path.py" --path-lines "$@"
} }