From 0b84b749deeeac4263822d659961ca50d8cea0f4 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Thu, 19 Jul 2018 10:08:31 -0700 Subject: [PATCH] [zsh] Conditionally load python stuff --- env.darwin | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/env.darwin b/env.darwin index f20f67b..9f5a97d 100644 --- a/env.darwin +++ b/env.darwin @@ -1,12 +1,15 @@ # vim: set ft=zsh: # Eryn Wells -for f in `ls "$HOME/Library/Python"`; do - prepend-to-path "$HOME/Library/Python/$f/bin" -done +pythonroot="$HOME/Library/Python" +if [[ -d "$pythonroot" ]]; then + for f in `ls "$pythonroot"`; do + prepend-to-path "$pythonroot/$f/bin" + done +fi prepend-to-path "/usr/local/go/bin" -py27local="$HOME/Library/Python/2.7/lib/python/site-packages" +py27local="$pythonroot/2.7/lib/python/site-packages" if [[ -d "$py27local" ]]; then if [[ ! -z $PYTHONPATH ]]; then PYTHONPATH=$py27local:$PYTHONPATH @@ -15,4 +18,5 @@ if [[ -d "$py27local" ]]; then fi fi unset py27local +unset pythonroot export PYTHONPATH