From 83dac3ddeb9bf5eb6a32f02e2e03f18c352643e6 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Mon, 15 Aug 2016 11:30:25 -0700 Subject: [PATCH] Make shell startup less noisy when pyenv missing --- dotfiles/lib/shellenv.sh | 4 ++-- dotfiles/lib/shellenv/functions.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dotfiles/lib/shellenv.sh b/dotfiles/lib/shellenv.sh index e99dd92f..1fb9e2b9 100644 --- a/dotfiles/lib/shellenv.sh +++ b/dotfiles/lib/shellenv.sh @@ -14,7 +14,7 @@ function add_to_path { # 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)" + 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 "$@") eval "$result" @@ -27,7 +27,7 @@ function get_python_scripts_path { function _setup_env { _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 _java_setup _go_setup diff --git a/dotfiles/lib/shellenv/functions.sh b/dotfiles/lib/shellenv/functions.sh index 944ccdfe..c977e99a 100644 --- a/dotfiles/lib/shellenv/functions.sh +++ b/dotfiles/lib/shellenv/functions.sh @@ -3,7 +3,7 @@ function path_lines { # 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)" + hash pyenv 2>/dev/null && python_command="$(pyenv which python)" || python_command="$(which python)" "$python_command" "$HOME/.lib/python/shell_path.py" --path-lines "$@" }